require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NFS_NFS_H_)) {
    eval 'sub _NFS_NFS_H_ () {1;}' unless defined(&_NFS_NFS_H_);
    eval 'sub NFS_TICKINTVL () {5;}' unless defined(&NFS_TICKINTVL);
    eval 'sub NFS_HZ () {( &hz /  &nfs_ticks);}' unless defined(&NFS_HZ);
    eval 'sub NFS_TIMEO () {(1*  &NFS_HZ);}' unless defined(&NFS_TIMEO);
    eval 'sub NFS_MINTIMEO () {(1*  &NFS_HZ);}' unless defined(&NFS_MINTIMEO);
    eval 'sub NFS_MAXTIMEO () {(60*  &NFS_HZ);}' unless defined(&NFS_MAXTIMEO);
    eval 'sub NFS_MINIDEMTIMEO () {(5*  &NFS_HZ);}' unless defined(&NFS_MINIDEMTIMEO);
    eval 'sub NFS_TIMEOUTMUL () {2;}' unless defined(&NFS_TIMEOUTMUL);
    eval 'sub NFS_MAXREXMIT () {100;}' unless defined(&NFS_MAXREXMIT);
    eval 'sub NFS_RETRANS () {10;}' unless defined(&NFS_RETRANS);
    eval 'sub NFS_MAXGRPS () {16;}' unless defined(&NFS_MAXGRPS);
    eval 'sub NFS_MINATTRTIMO () {5;}' unless defined(&NFS_MINATTRTIMO);
    eval 'sub NFS_MAXATTRTIMO () {60;}' unless defined(&NFS_MAXATTRTIMO);
    eval 'sub NFS_WSIZE () {8192;}' unless defined(&NFS_WSIZE);
    eval 'sub NFS_RSIZE () {8192;}' unless defined(&NFS_RSIZE);
    eval 'sub NFS_READDIRSIZE () {8192;}' unless defined(&NFS_READDIRSIZE);
    eval 'sub NFS_DEFRAHEAD () {1;}' unless defined(&NFS_DEFRAHEAD);
    eval 'sub NFS_MAXRAHEAD () {4;}' unless defined(&NFS_MAXRAHEAD);
    eval 'sub NFS_MAXASYNCDAEMON () {20;}' unless defined(&NFS_MAXASYNCDAEMON);
    eval 'sub NFS_DIRBLKSIZ () {1024;}' unless defined(&NFS_DIRBLKSIZ);
    eval 'sub NFS_READDIRBLKSIZ () {512;}' unless defined(&NFS_READDIRBLKSIZ);
    eval 'sub NFS_CMPFH {
        my($n, $f, $s) = @_;
	    eval q((-> &n_fhsize ==  && ! &bcmp(-> &n_fhp, ($f), ($s))));
    }' unless defined(&NFS_CMPFH);
    eval 'sub NFS_ISV3 {
        my($v) = @_;
	    eval q(( &VFSTONFS(($v)-> &v_mount)-> &nm_flag &  &NFSMNT_NFSV3));
    }' unless defined(&NFS_ISV3);
    eval 'sub NFS_SRVMAXDATA {
        my($n) = @_;
	    eval q(((($n)-> &nd_flag &  &ND_NFSV3) ? ((($n)-> &nd_nam2) ?  &NFS_MAXDGRAMDATA :  &NFS_MAXDATA) :  &NFS_V2MAXDATA));
    }' unless defined(&NFS_SRVMAXDATA);
    unless(defined(&M_NFSRVDESC)) {
	eval 'sub M_NFSRVDESC () { &M_TEMP;}' unless defined(&M_NFSRVDESC);
    }
    unless(defined(&M_NFSDIROFF)) {
	eval 'sub M_NFSDIROFF () { &M_TEMP;}' unless defined(&M_NFSDIROFF);
    }
    unless(defined(&M_NFSBIGFH)) {
	eval 'sub M_NFSBIGFH () { &M_TEMP;}' unless defined(&M_NFSBIGFH);
    }
    eval 'sub B_INVAFTERWRITE () { &B_INVAL;}' unless defined(&B_INVAFTERWRITE);
    eval 'sub NFSSVC_BIOD () {0x2;}' unless defined(&NFSSVC_BIOD);
    eval 'sub NFSSVC_NFSD () {0x4;}' unless defined(&NFSSVC_NFSD);
    eval 'sub NFSSVC_ADDSOCK () {0x8;}' unless defined(&NFSSVC_ADDSOCK);
    eval 'sub NFSSVC_AUTHIN () {0x10;}' unless defined(&NFSSVC_AUTHIN);
    eval 'sub NFSSVC_GOTAUTH () {0x40;}' unless defined(&NFSSVC_GOTAUTH);
    eval 'sub NFSSVC_AUTHINFAIL () {0x80;}' unless defined(&NFSSVC_AUTHINFAIL);
    eval 'sub NFSSVC_MNTD () {0x100;}' unless defined(&NFSSVC_MNTD);
    eval 'sub NFS_NFSSTATS () {1;}' unless defined(&NFS_NFSSTATS);
    eval 'sub NFS_NIOTHREADS () {2;}' unless defined(&NFS_NIOTHREADS);
    eval 'sub NFS_MAXID () {3;}' unless defined(&NFS_MAXID);
    eval 'sub FS_NFS_NAMES () {{ { 0, 0}, { "nfsstats",  &CTLTYPE_STRUCT }, { "iothreads",  &CTLTYPE_INT } };}' unless defined(&FS_NFS_NAMES);
    if(defined(&_KERNEL)) {
	eval 'sub NFSINT_SIGMASK () {( &sigmask( &SIGINT)| &sigmask( &SIGTERM)| &sigmask( &SIGKILL)|  &sigmask( &SIGHUP)| &sigmask( &SIGQUIT));}' unless defined(&NFSINT_SIGMASK);
	eval 'sub NFSIGNORE_SOERROR {
	    my($s, $e) = @_;
    	    eval q((($e) !=  &EINTR  && ($e) !=  &ERESTART  && ($e) !=  &EWOULDBLOCK  && (($s) &  &PR_CONNREQUIRED) == 0));
	}' unless defined(&NFSIGNORE_SOERROR);
	eval 'sub R_TIMING () {0x1;}' unless defined(&R_TIMING);
	eval 'sub R_SENT () {0x2;}' unless defined(&R_SENT);
	eval 'sub R_SOFTTERM () {0x4;}' unless defined(&R_SOFTTERM);
	eval 'sub R_INTR () {0x8;}' unless defined(&R_INTR);
	eval 'sub R_SOCKERR () {0x10;}' unless defined(&R_SOCKERR);
	eval 'sub R_TPRINTFMSG () {0x20;}' unless defined(&R_TPRINTFMSG);
	eval 'sub R_MUSTRESEND () {0x40;}' unless defined(&R_MUSTRESEND);
	eval 'sub NFS_MINRTO () {( &NFS_HZ >> 2);}' unless defined(&NFS_MINRTO);
	eval 'sub NFS_MAXRTO () {(20*  &NFS_HZ);}' unless defined(&NFS_MAXRTO);
	eval("sub NFS_DEFAULT_TIMER () { 0; }") unless defined(&NFS_DEFAULT_TIMER);
	eval("sub NFS_GETATTR_TIMER () { 1; }") unless defined(&NFS_GETATTR_TIMER);
	eval("sub NFS_LOOKUP_TIMER () { 2; }") unless defined(&NFS_LOOKUP_TIMER);
	eval("sub NFS_READ_TIMER () { 3; }") unless defined(&NFS_READ_TIMER);
	eval("sub NFS_WRITE_TIMER () { 4; }") unless defined(&NFS_WRITE_TIMER);
	eval 'sub NFS_MAX_TIMER () {( &NFS_WRITE_TIMER);}' unless defined(&NFS_MAX_TIMER);
	eval 'sub NFS_INITRTT () {( &NFS_HZ << 3);}' unless defined(&NFS_INITRTT);
	eval 'sub SLP_VALID () {0x1;}' unless defined(&SLP_VALID);
	eval 'sub SLP_DOREC () {0x2;}' unless defined(&SLP_DOREC);
	eval 'sub SLP_NEEDQ () {0x4;}' unless defined(&SLP_NEEDQ);
	eval 'sub SLP_DISCONN () {0x8;}' unless defined(&SLP_DISCONN);
	eval 'sub SLP_GETSTREAM () {0x10;}' unless defined(&SLP_GETSTREAM);
	eval 'sub SLP_LASTFRAG () {0x20;}' unless defined(&SLP_LASTFRAG);
	eval 'sub SLP_ALLFLAGS () {0xff;}' unless defined(&SLP_ALLFLAGS);
	eval 'sub SLP_INIT () {0x1;}' unless defined(&SLP_INIT);
	eval 'sub SLP_WANTINIT () {0x2;}' unless defined(&SLP_WANTINIT);
	eval 'sub NFSD_WAITING () {0x1;}' unless defined(&NFSD_WAITING);
	eval 'sub NFSD_REQINPROG () {0x2;}' unless defined(&NFSD_REQINPROG);
	eval 'sub NFSD_NEEDAUTH () {0x4;}' unless defined(&NFSD_NEEDAUTH);
	eval 'sub NFSD_AUTHFAIL () {0x8;}' unless defined(&NFSD_AUTHFAIL);
	eval 'sub ND_NFSV3 () {0x8;}' unless defined(&ND_NFSV3);
	eval 'sub NFSD_CHECKSLP () {0x1;}' unless defined(&NFSD_CHECKSLP);
    }
}
1;
