require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SYSTRACE_H_)) {
    eval 'sub _SYSTRACE_H_ () {1;}' unless defined(&_SYSTRACE_H_);
    require 'sys/ioccom.ph';
    require 'sys/rwlock.ph';
    eval 'sub SYSTR_EMULEN () {8;}' unless defined(&SYSTR_EMULEN);
    eval 'sub SYSTR_MAX_POLICIES () {64;}' unless defined(&SYSTR_MAX_POLICIES);
    eval 'sub SYSTR_MAXARGS () {64;}' unless defined(&SYSTR_MAXARGS);
    eval 'sub SYSTR_MAXFNAME () {8;}' unless defined(&SYSTR_MAXFNAME);
    eval 'sub SYSTR_MAXINJECTS () {8;}' unless defined(&SYSTR_MAXINJECTS);
    eval 'sub SYSTR_MAXREPLEN () {2048;}' unless defined(&SYSTR_MAXREPLEN);
    eval 'sub SYSTR_MSG_ASK () {1;}' unless defined(&SYSTR_MSG_ASK);
    eval 'sub SYSTR_MSG_RES () {2;}' unless defined(&SYSTR_MSG_RES);
    eval 'sub SYSTR_MSG_EMUL () {3;}' unless defined(&SYSTR_MSG_EMUL);
    eval 'sub SYSTR_MSG_CHILD () {4;}' unless defined(&SYSTR_MSG_CHILD);
    eval 'sub SYSTR_MSG_UGID () {5;}' unless defined(&SYSTR_MSG_UGID);
    eval 'sub SYSTR_MSG_POLICYFREE () {6;}' unless defined(&SYSTR_MSG_POLICYFREE);
    eval 'sub SYSTR_MSG_EXECVE () {7;}' unless defined(&SYSTR_MSG_EXECVE);
    eval 'sub SYSTR_MSG_NOPROCESS {
        my($x) = @_;
	    eval q((($x)-> ($msg->{msg_type}) ==  &SYSTR_MSG_CHILD || ($x)-> ($msg->{msg_type}) ==  &SYSTR_MSG_POLICYFREE));
    }' unless defined(&SYSTR_MSG_NOPROCESS);
    eval 'sub SYSTR_READ () {1;}' unless defined(&SYSTR_READ);
    eval 'sub SYSTR_WRITE () {2;}' unless defined(&SYSTR_WRITE);
    eval 'sub SYSTR_POLICY_NEW () {1;}' unless defined(&SYSTR_POLICY_NEW);
    eval 'sub SYSTR_POLICY_ASSIGN () {2;}' unless defined(&SYSTR_POLICY_ASSIGN);
    eval 'sub SYSTR_POLICY_MODIFY () {3;}' unless defined(&SYSTR_POLICY_MODIFY);
    eval 'sub strp_pid () { ($strp_data->{pid});}' unless defined(&strp_pid);
    eval 'sub strp_maxents () { ($strp_data->{maxents});}' unless defined(&strp_maxents);
    eval 'sub strp_code () { ($strp_data->{assign}->{code});}' unless defined(&strp_code);
    eval 'sub strp_policy () { ($strp_data->{assign}->{policy});}' unless defined(&strp_policy);
    eval 'sub SYSTR_NOLINKS () {1;}' unless defined(&SYSTR_NOLINKS);
    eval 'sub STRIOCCLONE () { &_IOR(ord(\'s\'), 100, \'int\');}' unless defined(&STRIOCCLONE);
    eval 'sub SYSTR_CLONE () { &STRIOCCLONE;}' unless defined(&SYSTR_CLONE);
    eval 'sub STRIOCATTACH () { &_IOW(ord(\'s\'), 101,  &pid_t);}' unless defined(&STRIOCATTACH);
    eval 'sub STRIOCDETACH () { &_IOW(ord(\'s\'), 102,  &pid_t);}' unless defined(&STRIOCDETACH);
    eval 'sub STRIOCANSWER () { &_IOW(ord(\'s\'), 103, \'struct systrace_answer\');}' unless defined(&STRIOCANSWER);
    eval 'sub STRIOCIO () { &_IOWR(ord(\'s\'), 104, \'struct systrace_io\');}' unless defined(&STRIOCIO);
    eval 'sub STRIOCPOLICY () { &_IOWR(ord(\'s\'), 105, \'struct systrace_policy\');}' unless defined(&STRIOCPOLICY);
    eval 'sub STRIOCGETCWD () { &_IOW(ord(\'s\'), 106,  &pid_t);}' unless defined(&STRIOCGETCWD);
    eval 'sub STRIOCRESCWD () { &_IO(ord(\'s\'), 107);}' unless defined(&STRIOCRESCWD);
    eval 'sub STRIOCREPORT () { &_IOW(ord(\'s\'), 108,  &pid_t);}' unless defined(&STRIOCREPORT);
    eval 'sub STRIOCREPLACE () { &_IOW(ord(\'s\'), 109, \'struct systrace_replace\');}' unless defined(&STRIOCREPLACE);
    eval 'sub STRIOCSCRIPTNAME () { &_IOW(ord(\'s\'), 110, \'struct systrace_scriptname\');}' unless defined(&STRIOCSCRIPTNAME);
    eval 'sub STRIOCINJECT () { &_IOWR(ord(\'s\'), 111, \'struct systrace_inject\');}' unless defined(&STRIOCINJECT);
    eval 'sub SYSTR_POLICY_ASK () {0;}' unless defined(&SYSTR_POLICY_ASK);
    eval 'sub SYSTR_POLICY_PERMIT () {1;}' unless defined(&SYSTR_POLICY_PERMIT);
    eval 'sub SYSTR_POLICY_NEVER () {2;}' unless defined(&SYSTR_POLICY_NEVER);
    eval 'sub SYSTR_FLAGS_RESULT () {0x1;}' unless defined(&SYSTR_FLAGS_RESULT);
    eval 'sub SYSTR_FLAGS_SETEUID () {0x2;}' unless defined(&SYSTR_FLAGS_SETEUID);
    eval 'sub SYSTR_FLAGS_SETEGID () {0x4;}' unless defined(&SYSTR_FLAGS_SETEGID);
    if(defined(&_KERNEL)) {
	require 'sys/namei.ph';
    }
}
1;
