require '_h2ph_pre.ph';

no warnings 'redefine';

eval("sub Proot () { 0; }") unless defined(&Proot);
eval("sub Pcurproc () { 1; }") unless defined(&Pcurproc);
eval("sub Pself () { 2; }") unless defined(&Pself);
eval("sub Pproc () { 3; }") unless defined(&Pproc);
eval("sub Pfile () { 4; }") unless defined(&Pfile);
eval("sub Pmem () { 5; }") unless defined(&Pmem);
eval("sub Pregs () { 6; }") unless defined(&Pregs);
eval("sub Pfpregs () { 7; }") unless defined(&Pfpregs);
eval("sub Pctl () { 8; }") unless defined(&Pctl);
eval("sub Pstatus () { 9; }") unless defined(&Pstatus);
eval("sub Pnote () { 10; }") unless defined(&Pnote);
eval("sub Pnotepg () { 11; }") unless defined(&Pnotepg);
eval("sub Pcmdline () { 12; }") unless defined(&Pcmdline);
eval("sub Pmeminfo () { 13; }") unless defined(&Pmeminfo);
eval("sub Pcpuinfo () { 14; }") unless defined(&Pcpuinfo);
unless(defined(&PROCFS_NOTELEN)) {
    sub PROCFS_NOTELEN () {	64;}
}
unless(defined(&PROCFS_CTLLEN)) {
    sub PROCFS_CTLLEN () {	8;}
}
if(defined(&_KERNEL)) {
    eval 'sub CNEQ {
        my($cnp, $s, $len) = @_;
	    eval q((($cnp)-> &cn_namelen == ($len)  && ( &bcmp(($s), ($cnp)-> &cn_nameptr, ($len)) == 0)));
    }' unless defined(&CNEQ);
    eval 'sub UIO_MX () {32;}' unless defined(&UIO_MX);
    eval 'sub PROCFS_FILENO {
        my($pid, $type) = @_;
	    eval q((( <  &Pproc) ? ( + 4) : (((+1) << 5) + ( ($type)))));
    }' unless defined(&PROCFS_FILENO);
    eval 'sub VFSTOPROC {
        my($mp) = @_;
	    eval q((($mp)-> &mnt_data));
    }' unless defined(&VFSTOPROC);
    eval 'sub VTOPFS {
        my($vp) = @_;
	    eval q((($vp)-> &v_data));
    }' unless defined(&VTOPFS);
    eval 'sub PFSTOV {
        my($pfs) = @_;
	    eval q((($pfs)-> &pfs_vnode));
    }' unless defined(&PFSTOV);
    eval 'sub PROCFS_LOCKED () {0x1;}' unless defined(&PROCFS_LOCKED);
    eval 'sub PROCFS_WANT () {0x2;}' unless defined(&PROCFS_WANT);
}
1;
