require '_h2ph_pre.ph';

unless(defined(&_SYS_EXEC_H_)) {
    eval 'sub _SYS_EXEC_H_ () {1;}' unless defined(&_SYS_EXEC_H_);
    eval 'sub PS_STRINGS () {(( &USRSTACK - $sizeof{\'struct ps_strings\'}));}' unless defined(&PS_STRINGS);
    if(defined( &COMPAT_SUNOS) || defined( &COMPAT_ULTRIX) || defined( &COMPAT_IBCS2) || defined( &COMPAT_SVR4) || defined( &COMPAT_OSF1) || defined( &COMPAT_LINUX) || defined( &COMPAT_FREEBSD) || defined( &COMPAT_HPUX) || defined( &COMPAT_NETBSD)) {
	eval 'sub STACKGAPLEN () {400;}' unless defined(&STACKGAPLEN);
    } else {
	eval 'sub STACKGAPLEN () {0;}' unless defined(&STACKGAPLEN);
    }
    eval 'sub STACKGAPBASE_UNALIGNED () {( &PS_STRINGS -  &szsigcode -  &STACKGAPLEN);}' unless defined(&STACKGAPBASE_UNALIGNED);
    eval 'sub STACKGAPBASE () {(((  &STACKGAPBASE_UNALIGNED) & ~ &ALIGNBYTES));}' unless defined(&STACKGAPBASE);
    eval 'sub EXEC_DEFAULT_VMCMD_SETSIZE () {5;}' unless defined(&EXEC_DEFAULT_VMCMD_SETSIZE);
    eval 'sub EXEC_INDIR () {0x0001;}' unless defined(&EXEC_INDIR);
    eval 'sub EXEC_HASFD () {0x0002;}' unless defined(&EXEC_HASFD);
    eval 'sub EXEC_HASARGL () {0x0004;}' unless defined(&EXEC_HASARGL);
    eval 'sub EXEC_SKIPARG () {0x0008;}' unless defined(&EXEC_SKIPARG);
    eval 'sub EXEC_DESTR () {0x0010;}' unless defined(&EXEC_DESTR);
    if(defined(&_KERNEL)) {
	if(defined(&DEBUG)) {
	    eval 'sub NEW_VMCMD {
	        local($evsp,$proc,$len,$addr,$vp,$offset,$prot) = @_;
    		eval q( &new_vmcmd($evsp,$proc,$len,$addr,$vp,$offset,$prot););
	    }' unless defined(&NEW_VMCMD);
	} else {
	    eval 'sub NEW_VMCMD {
	        local($evsp,$proc,$len,$addr,$vp,$offset,$prot) = @_;
    		eval q({ \'struct exec_vmcmd\' * &vcp;  &if (($evsp)-> &evs_used >= ($evsp)-> &evs_cnt)  &vmcmdset_extend($evsp);  &vcp = ($evsp)-> $evs_cmds[($evsp)-> &evs_used++];  ($vcp->{ev_proc}) = ($proc);  ($vcp->{ev_len}) = ($len);  ($vcp->{ev_addr}) = ($addr);  &if (( ($vcp->{ev_vp}) = ($vp)) !=  &NULLVP)  &VREF($vp);  ($vcp->{ev_offset}) = ($offset);  ($vcp->{ev_prot}) = ($prot); });
	    }' unless defined(&NEW_VMCMD);
	}
    }
    require 'sys/exec_aout.ph';
    require 'machine/exec.ph';
}
1;
