require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_FSTYPES_H_)) {
    eval 'sub _SYS_FSTYPES_H_ () {1;}' unless defined(&_SYS_FSTYPES_H_);
    if(defined(&_KERNEL)) {
	eval 'sub FHANDLE_SIZE_COMPAT () {28;}' unless defined(&FHANDLE_SIZE_COMPAT);
	eval 'sub FHANDLE_SIZE_MAX () {1024;}' unless defined(&FHANDLE_SIZE_MAX);
	eval 'sub FHANDLE_SIZE_MIN () { &FHANDLE_SIZE_COMPAT;}' unless defined(&FHANDLE_SIZE_MIN);
	eval 'sub FHANDLE_FSID {
	    my($fh) = @_;
    	    eval q((($fh)-> &fh_fsid));
	}' unless defined(&FHANDLE_FSID);
	eval 'sub FHANDLE_FILEID {
	    my($fh) = @_;
    	    eval q((($fh)-> &fh_fid));
	}' unless defined(&FHANDLE_FILEID);
	eval 'sub FHANDLE_SIZE_FROM_FILEID_SIZE {
	    my($fidsize) = @_;
    	    eval q( &MAX( &FHANDLE_SIZE_MIN, ( &offsetof( &fhandle_t,  &fh_fid) + ($fidsize))));
	}' unless defined(&FHANDLE_SIZE_FROM_FILEID_SIZE);
	eval 'sub FHANDLE_SIZE {
	    my($fh) = @_;
    	    eval q( &FHANDLE_SIZE_FROM_FILEID_SIZE( &FHANDLE_FILEID($fh)-> &fid_len));
	}' unless defined(&FHANDLE_SIZE);
    }
    eval 'sub MNT_RDONLY () {0x1;}' unless defined(&MNT_RDONLY);
    eval 'sub MNT_SYNCHRONOUS () {0x2;}' unless defined(&MNT_SYNCHRONOUS);
    eval 'sub MNT_NOEXEC () {0x4;}' unless defined(&MNT_NOEXEC);
    eval 'sub MNT_NOSUID () {0x8;}' unless defined(&MNT_NOSUID);
    eval 'sub MNT_NODEV () {0x10;}' unless defined(&MNT_NODEV);
    eval 'sub MNT_UNION () {0x20;}' unless defined(&MNT_UNION);
    eval 'sub MNT_ASYNC () {0x40;}' unless defined(&MNT_ASYNC);
    eval 'sub MNT_NOCOREDUMP () {0x8000;}' unless defined(&MNT_NOCOREDUMP);
    eval 'sub MNT_RELATIME () {0x20000;}' unless defined(&MNT_RELATIME);
    eval 'sub MNT_IGNORE () {0x100000;}' unless defined(&MNT_IGNORE);
    eval 'sub MNT_NFS4ACLS () {0x200000;}' unless defined(&MNT_NFS4ACLS);
    eval 'sub MNT_DISCARD () {0x800000;}' unless defined(&MNT_DISCARD);
    eval 'sub MNT_EXTATTR () {0x1000000;}' unless defined(&MNT_EXTATTR);
    eval 'sub MNT_LOG () {0x2000000;}' unless defined(&MNT_LOG);
    eval 'sub MNT_NOATIME () {0x4000000;}' unless defined(&MNT_NOATIME);
    eval 'sub MNT_AUTOMOUNTED () {0x10000000;}' unless defined(&MNT_AUTOMOUNTED);
    eval 'sub MNT_SYMPERM () {0x20000000;}' unless defined(&MNT_SYMPERM);
    eval 'sub MNT_NODEVMTIME () {0x40000000;}' unless defined(&MNT_NODEVMTIME);
    eval 'sub MNT_SOFTDEP () {0x80000000;}' unless defined(&MNT_SOFTDEP);
    eval 'sub MNT_POSIX1EACLS () {0x800;}' unless defined(&MNT_POSIX1EACLS);
    eval 'sub MNT_ACLS () { &MNT_POSIX1EACLS;}' unless defined(&MNT_ACLS);
    eval 'sub __MNT_BASIC_FLAGS () {{  &MNT_ASYNC, 0, "asynchronous" }, {  &MNT_AUTOMOUNTED, 0, "automounted" }, {  &MNT_NFS4ACLS, 0, "nfs4acls" }, {  &MNT_POSIX1EACLS, 0, "posix1eacls" }, {  &MNT_DISCARD, 0, "discard" }, {  &MNT_EXTATTR, 0, "extattr" }, {  &MNT_IGNORE, 0, "hidden" }, {  &MNT_LOG, 0, "log" }, {  &MNT_NOATIME, 0, "noatime" }, {  &MNT_NOCOREDUMP, 0, "nocoredump" }, {  &MNT_NODEV, 0, "nodev" }, {  &MNT_NODEVMTIME, 0, "nodevmtime" }, {  &MNT_NOEXEC, 0, "noexec" }, {  &MNT_NOSUID, 0, "nosuid" }, {  &MNT_RDONLY, 0, "read-only" }, {  &MNT_RELATIME, 0, "relatime" }, {  &MNT_SOFTDEP, 0, "soft dependencies" }, {  &MNT_SYMPERM, 0, "symperm" }, {  &MNT_SYNCHRONOUS, 0, "synchronous" }, {  &MNT_UNION, 0, "union" },;}' unless defined(&__MNT_BASIC_FLAGS);
    eval 'sub MNT_BASIC_FLAGS () {( &MNT_ASYNC |  &MNT_AUTOMOUNTED |  &MNT_DISCARD |  &MNT_EXTATTR |  &MNT_LOG |  &MNT_NOATIME |  &MNT_NOCOREDUMP |  &MNT_NODEV |  &MNT_NODEVMTIME |  &MNT_NOEXEC |  &MNT_NOSUID |  &MNT_RDONLY |  &MNT_RELATIME |  &MNT_SOFTDEP |  &MNT_SYMPERM |  &MNT_SYNCHRONOUS |  &MNT_UNION |  &MNT_NFS4ACLS |  &MNT_POSIX1EACLS);}' unless defined(&MNT_BASIC_FLAGS);
    eval 'sub MNT_EXRDONLY () {0x80;}' unless defined(&MNT_EXRDONLY);
    eval 'sub MNT_EXPORTED () {0x100;}' unless defined(&MNT_EXPORTED);
    eval 'sub MNT_DEFEXPORTED () {0x200;}' unless defined(&MNT_DEFEXPORTED);
    eval 'sub MNT_EXPORTANON () {0x400;}' unless defined(&MNT_EXPORTANON);
    eval 'sub MNT_EXKERB () {0x800;}' unless defined(&MNT_EXKERB);
    eval 'sub MNT_EXNORESPORT () {0x8000000;}' unless defined(&MNT_EXNORESPORT);
    eval 'sub MNT_EXPUBLIC () {0x10000000;}' unless defined(&MNT_EXPUBLIC);
    eval 'sub __MNT_EXPORTED_FLAGS () {{  &MNT_EXRDONLY, 1, "exported read-only" }, {  &MNT_EXPORTED, 0, "NFS exported" }, {  &MNT_DEFEXPORTED, 1, "exported to the world" }, {  &MNT_EXPORTANON, 1, "anon uid mapping" }, {  &MNT_EXKERB, 1, "kerberos uid mapping/posix1e ACLS" }, {  &MNT_EXNORESPORT, 0, "non-reserved ports" }, {  &MNT_EXPUBLIC, 0, "WebNFS exports" },;}' unless defined(&__MNT_EXPORTED_FLAGS);
    eval 'sub MNT_LOCAL () {0x1000;}' unless defined(&MNT_LOCAL);
    eval 'sub MNT_QUOTA () {0x2000;}' unless defined(&MNT_QUOTA);
    eval 'sub MNT_ROOTFS () {0x4000;}' unless defined(&MNT_ROOTFS);
    eval 'sub __MNT_INTERNAL_FLAGS () {{  &MNT_LOCAL, 0, "local" }, {  &MNT_QUOTA, 0, "with quotas" }, {  &MNT_ROOTFS, 1, "root file system" },;}' unless defined(&__MNT_INTERNAL_FLAGS);
    eval 'sub MNT_VISFLAGMASK () {(  &MNT_RDONLY |  &MNT_SYNCHRONOUS |  &MNT_NOEXEC |  &MNT_NOSUID |  &MNT_NODEV |  &MNT_UNION |  &MNT_NFS4ACLS |  &MNT_ASYNC |  &MNT_NOCOREDUMP |  &MNT_IGNORE |  &MNT_DISCARD |  &MNT_NOATIME |  &MNT_SYMPERM |  &MNT_NODEVMTIME |  &MNT_SOFTDEP |  &MNT_EXRDONLY |  &MNT_EXPORTED |  &MNT_DEFEXPORTED |  &MNT_EXPORTANON |  &MNT_EXKERB |  &MNT_EXNORESPORT |  &MNT_EXPUBLIC |  &MNT_LOCAL |  &MNT_QUOTA |  &MNT_ROOTFS |  &MNT_LOG |  &MNT_POSIX1EACLS |  &MNT_EXTATTR |  &MNT_AUTOMOUNTED);}' unless defined(&MNT_VISFLAGMASK);
    eval 'sub MNT_UPDATE () {0x10000;}' unless defined(&MNT_UPDATE);
    eval 'sub MNT_RELOAD () {0x40000;}' unless defined(&MNT_RELOAD);
    eval 'sub MNT_FORCE () {0x80000;}' unless defined(&MNT_FORCE);
    eval 'sub MNT_GETARGS () {0x400000;}' unless defined(&MNT_GETARGS);
    eval 'sub MNT_OP_FLAGS () {( &MNT_UPDATE| &MNT_RELOAD| &MNT_FORCE| &MNT_GETARGS);}' unless defined(&MNT_OP_FLAGS);
    eval 'sub __MNT_EXTERNAL_FLAGS () {{  &MNT_UPDATE, 1, "being updated" }, {  &MNT_RELOAD, 1, "reload filesystem data" }, {  &MNT_FORCE, 1, "force unmount or readonly change" }, {  &MNT_GETARGS, 1, "retrieve mount arguments" },;}' unless defined(&__MNT_EXTERNAL_FLAGS);
    eval 'sub IMNT_GONE () {0x1;}' unless defined(&IMNT_GONE);
    eval 'sub IMNT_UNMOUNT () {0x2;}' unless defined(&IMNT_UNMOUNT);
    eval 'sub IMNT_WANTRDWR () {0x4;}' unless defined(&IMNT_WANTRDWR);
    eval 'sub IMNT_WANTRDONLY () {0x8;}' unless defined(&IMNT_WANTRDONLY);
    eval 'sub IMNT_NCLOOKUP () {0x20;}' unless defined(&IMNT_NCLOOKUP);
    eval 'sub IMNT_DTYPE () {0x40;}' unless defined(&IMNT_DTYPE);
    eval 'sub IMNT_SHRLOOKUP () {0x80;}' unless defined(&IMNT_SHRLOOKUP);
    eval 'sub IMNT_MPSAFE () {0x100;}' unless defined(&IMNT_MPSAFE);
    eval 'sub IMNT_CAN_RWTORO () {0x200;}' unless defined(&IMNT_CAN_RWTORO);
    eval 'sub IMNT_ONWORKLIST () {0x400;}' unless defined(&IMNT_ONWORKLIST);
    eval 'sub __MNT_FLAGS () { &__MNT_BASIC_FLAGS  &__MNT_EXPORTED_FLAGS  &__MNT_INTERNAL_FLAGS  &__MNT_EXTERNAL_FLAGS;}' unless defined(&__MNT_FLAGS);
    eval 'sub __MNT_FLAG_BITS () {"\\20" "\\40MNT_SOFTDEP" "\\37MNT_NODEVMTIME" "\\36MNT_SYMPERM" "\\35MNT_EXPUBLIC" "\\34MNT_EXNORESPORT" "\\33MNT_NOATIME" "\\32MNT_LOG" "\\31MNT_EXTATTR" "\\30MNT_DISCARD" "\\27MNT_GETARGS" "\\26MNT_NFS4ACLS" "\\25MNT_IGNORE" "\\24MNT_FORCE" "\\23MNT_RELOAD" "\\22MNT_RELATIME" "\\21MNT_UPDATE" "\\20MNT_NOCOREDUMP" "\\17MNT_ROOTFS" "\\16MNT_QUOTA" "\\15MNT_LOCAL" "\\14MNT_EXKERB|MNT_POSIX1EACLS" "\\13MNT_EXPORTANON" "\\12MNT_DEFEXPORTED" "\\11MNT_EXPORTED" "\\10MNT_EXRDONLY" "\\07MNT_ASYNC" "\\06MNT_UNION" "\\05MNT_NODEV" "\\04MNT_NOSUID" "\\03MNT_NOEXEC" "\\02MNT_SYNCHRONOUS" "\\01MNT_RDONLY";}' unless defined(&__MNT_FLAG_BITS);
    eval 'sub __IMNT_FLAG_BITS () {"\\20" "\\13IMNT_ONWORKLIST" "\\12IMNT_CAN_RWTORO" "\\11IMNT_MPSAFE" "\\10IMNT_SHRLOOKUP" "\\07IMNT_DTYPE" "\\06IMNT_NCLOOKUP" "\\04IMNT_WANTRDONLY" "\\03IMNT_WANTRDWR" "\\02IMNT_UNMOUNT" "\\01IMNT_GONE";}' unless defined(&__IMNT_FLAG_BITS);
    eval 'sub MNT_WAIT () {1;}' unless defined(&MNT_WAIT);
    eval 'sub MNT_NOWAIT () {2;}' unless defined(&MNT_NOWAIT);
    eval 'sub MNT_LAZY () {3;}' unless defined(&MNT_LAZY);
}
1;
