require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_EXEC_H_)) {
    eval 'sub _SYS_EXEC_H_ () {1;}' unless defined(&_SYS_EXEC_H_);
    if(defined(&_KERNEL)) {
    }
    if(defined(&_KERNEL)) {
	require 'sys/uio.ph';
	require 'sys/rwlock.ph';
	eval 'sub EXECSW_PRIO_ANY () {0x;}' unless defined(&EXECSW_PRIO_ANY);
	eval 'sub EXECSW_PRIO_FIRST () {0x1;}' unless defined(&EXECSW_PRIO_FIRST);
	eval 'sub EXECSW_PRIO_LAST () {0x2;}' unless defined(&EXECSW_PRIO_LAST);
	eval 'sub EXEC_DEFAULT_VMCMD_SETSIZE () {9;}' unless defined(&EXEC_DEFAULT_VMCMD_SETSIZE);
	eval 'sub EXEC_INDIR () {0x1;}' unless defined(&EXEC_INDIR);
	eval 'sub EXEC_HASFD () {0x2;}' unless defined(&EXEC_HASFD);
	eval 'sub EXEC_HASARGL () {0x4;}' unless defined(&EXEC_HASARGL);
	eval 'sub EXEC_SKIPARG () {0x8;}' unless defined(&EXEC_SKIPARG);
	eval 'sub EXEC_DESTR () {0x10;}' unless defined(&EXEC_DESTR);
	eval 'sub EXEC_32 () {0x20;}' unless defined(&EXEC_32);
	eval 'sub EXEC_FORCEAUX () {0x40;}' unless defined(&EXEC_FORCEAUX);
	eval 'sub EXEC_TOPDOWN_VM () {0x80;}' unless defined(&EXEC_TOPDOWN_VM);
	eval 'sub EXEC_FROM32 () {0x100;}' unless defined(&EXEC_FROM32);
	eval 'sub VMCMD_RELATIVE () {0x1;}' unless defined(&VMCMD_RELATIVE);
	eval 'sub VMCMD_BASE () {0x2;}' unless defined(&VMCMD_BASE);
	eval 'sub VMCMD_FIXED () {0x4;}' unless defined(&VMCMD_FIXED);
	eval 'sub VMCMD_STACK () {0x8;}' unless defined(&VMCMD_STACK);
	eval 'sub NEW_VMCMD {
	    my($evsp,$lwp,$len,$addr,$vp,$offset,$prot) = @_;
    	    eval q( &new_vmcmd($evsp,$lwp,$len,$addr,$vp,$offset,$prot,0));
	}' unless defined(&NEW_VMCMD);
	eval 'sub NEW_VMCMD2 {
	    my($evsp,$lwp,$len,$addr,$vp,$offset,$prot,$flags) = @_;
    	    eval q( &new_vmcmd($evsp,$lwp,$len,$addr,$vp,$offset,$prot,$flags));
	}' unless defined(&NEW_VMCMD2);
    }
}
1;
