require '_h2ph_pre.ph';

unless(defined(&_FCNTL_H)) {
    die("Never use <bits/fcntl.h> directly; include <fcntl.h> instead.");
}
require 'sys/types.ph';
unless(defined(&O_ACCMODE)) {
    sub O_ACCMODE () {	0003;}
}
unless(defined(&O_RDONLY)) {
    sub O_RDONLY () {	00;}
}
unless(defined(&O_WRONLY)) {
    sub O_WRONLY () {	01;}
}
unless(defined(&O_RDWR)) {
    sub O_RDWR () {	02;}
}
unless(defined(&O_CREAT)) {
    sub O_CREAT () {	0100;}
}
unless(defined(&O_EXCL)) {
    sub O_EXCL () {	0200;}
}
unless(defined(&O_NOCTTY)) {
    sub O_NOCTTY () {	0400;}
}
unless(defined(&O_TRUNC)) {
    sub O_TRUNC () {	01000;}
}
unless(defined(&O_APPEND)) {
    sub O_APPEND () {	02000;}
}
unless(defined(&O_NONBLOCK)) {
    sub O_NONBLOCK () {	04000;}
}
unless(defined(&O_NDELAY)) {
    sub O_NDELAY () {	 &O_NONBLOCK;}
}
unless(defined(&O_SYNC)) {
    sub O_SYNC () {	010000;}
}
unless(defined(&O_FSYNC)) {
    sub O_FSYNC () {	 &O_SYNC;}
}
unless(defined(&O_ASYNC)) {
    sub O_ASYNC () {	020000;}
}
if(defined(&__USE_GNU)) {
    eval 'sub O_DIRECT () {040000;}' unless defined(&O_DIRECT);
    eval 'sub O_DIRECTORY () {0200000;}' unless defined(&O_DIRECTORY);
    eval 'sub O_NOFOLLOW () {0400000;}' unless defined(&O_NOFOLLOW);
}
if(defined (defined(&__USE_POSIX199309) ? &__USE_POSIX199309 : 0) || defined (defined(&__USE_UNIX98) ? &__USE_UNIX98 : 0)) {
    eval 'sub O_DSYNC () { &O_SYNC;}' unless defined(&O_DSYNC);
    eval 'sub O_RSYNC () { &O_SYNC;}' unless defined(&O_RSYNC);
}
if(defined(&__USE_LARGEFILE64)) {
    eval 'sub O_LARGEFILE () {0100000;}' unless defined(&O_LARGEFILE);
}
unless(defined(&F_DUPFD)) {
    sub F_DUPFD () {	0;}
}
unless(defined(&F_GETFD)) {
    sub F_GETFD () {	1;}
}
unless(defined(&F_SETFD)) {
    sub F_SETFD () {	2;}
}
unless(defined(&F_GETFL)) {
    sub F_GETFL () {	3;}
}
unless(defined(&F_SETFL)) {
    sub F_SETFL () {	4;}
}
unless(defined(&__USE_FILE_OFFSET64)) {
    eval 'sub F_GETLK () {5;}' unless defined(&F_GETLK);
    eval 'sub F_SETLK () {6;}' unless defined(&F_SETLK);
    eval 'sub F_SETLKW () {7;}' unless defined(&F_SETLKW);
} else {
    eval 'sub F_GETLK () { &F_GETLK64;}' unless defined(&F_GETLK);
    eval 'sub F_SETLK () { &F_SETLK64;}' unless defined(&F_SETLK);
    eval 'sub F_SETLKW () { &F_SETLKW64;}' unless defined(&F_SETLKW);
}
unless(defined(&F_GETLK64)) {
    sub F_GETLK64 () {	12;}
}
unless(defined(&F_SETLK64)) {
    sub F_SETLK64 () {	13;}
}
unless(defined(&F_SETLKW64)) {
    sub F_SETLKW64 () {	14;}
}
if(defined (defined(&__USE_BSD) ? &__USE_BSD : 0) || defined (defined(&__USE_XOPEN2K) ? &__USE_XOPEN2K : 0)) {
    eval 'sub F_SETOWN () {8;}' unless defined(&F_SETOWN);
    eval 'sub F_GETOWN () {9;}' unless defined(&F_GETOWN);
}
if(defined(&__USE_GNU)) {
    eval 'sub F_SETSIG () {10;}' unless defined(&F_SETSIG);
    eval 'sub F_GETSIG () {11;}' unless defined(&F_GETSIG);
}
if(defined(&__USE_GNU)) {
    eval 'sub F_SETLEASE () {1024;}' unless defined(&F_SETLEASE);
    eval 'sub F_GETLEASE () {1025;}' unless defined(&F_GETLEASE);
    eval 'sub F_NOTIFY () {1026;}' unless defined(&F_NOTIFY);
}
unless(defined(&FD_CLOEXEC)) {
    sub FD_CLOEXEC () {	1;}
}
unless(defined(&F_RDLCK)) {
    sub F_RDLCK () {	0;}
}
unless(defined(&F_WRLCK)) {
    sub F_WRLCK () {	1;}
}
unless(defined(&F_UNLCK)) {
    sub F_UNLCK () {	2;}
}
unless(defined(&F_EXLCK)) {
    sub F_EXLCK () {	4;}
}
unless(defined(&F_SHLCK)) {
    sub F_SHLCK () {	8;}
}
if(defined(&__USE_BSD)) {
    eval 'sub LOCK_SH () {1;}' unless defined(&LOCK_SH);
    eval 'sub LOCK_EX () {2;}' unless defined(&LOCK_EX);
    eval 'sub LOCK_NB () {4;}' unless defined(&LOCK_NB);
    eval 'sub LOCK_UN () {8;}' unless defined(&LOCK_UN);
}
if(defined(&__USE_GNU)) {
    eval 'sub LOCK_MAND () {32;}' unless defined(&LOCK_MAND);
    eval 'sub LOCK_READ () {64;}' unless defined(&LOCK_READ);
    eval 'sub LOCK_WRITE () {128;}' unless defined(&LOCK_WRITE);
    eval 'sub LOCK_RW () {192;}' unless defined(&LOCK_RW);
}
if(defined(&__USE_GNU)) {
    eval 'sub DN_ACCESS () {0x1;}' unless defined(&DN_ACCESS);
    eval 'sub DN_MODIFY () {0x2;}' unless defined(&DN_MODIFY);
    eval 'sub DN_CREATE () {0x4;}' unless defined(&DN_CREATE);
    eval 'sub DN_DELETE () {0x8;}' unless defined(&DN_DELETE);
    eval 'sub DN_RENAME () {0x10;}' unless defined(&DN_RENAME);
    eval 'sub DN_ATTRIB () {0x20;}' unless defined(&DN_ATTRIB);
    eval 'sub DN_MULTISHOT () {0x80000000;}' unless defined(&DN_MULTISHOT);
}
unless(defined(&__USE_FILE_OFFSET64)) {
} else {
}
if(defined(&__USE_LARGEFILE64)) {
}
if(defined(&__USE_BSD)) {
    eval 'sub FAPPEND () { &O_APPEND;}' unless defined(&FAPPEND);
    eval 'sub FFSYNC () { &O_FSYNC;}' unless defined(&FFSYNC);
    eval 'sub FASYNC () { &O_ASYNC;}' unless defined(&FASYNC);
    eval 'sub FNONBLOCK () { &O_NONBLOCK;}' unless defined(&FNONBLOCK);
    eval 'sub FNDELAY () { &O_NDELAY;}' unless defined(&FNDELAY);
}
if(defined(&__USE_XOPEN2K)) {
    eval 'sub POSIX_FADV_NORMAL () {0;}' unless defined(&POSIX_FADV_NORMAL);
    eval 'sub POSIX_FADV_RANDOM () {1;}' unless defined(&POSIX_FADV_RANDOM);
    eval 'sub POSIX_FADV_SEQUENTIAL () {2;}' unless defined(&POSIX_FADV_SEQUENTIAL);
    eval 'sub POSIX_FADV_WILLNEED () {3;}' unless defined(&POSIX_FADV_WILLNEED);
    eval 'sub POSIX_FADV_DONTNEED () {4;}' unless defined(&POSIX_FADV_DONTNEED);
    eval 'sub POSIX_FADV_NOREUSE () {5;}' unless defined(&POSIX_FADV_NOREUSE);
}
1;
