1#if !defined ISO && !defined ISO99 && !defined ISO11
2constant F_DUPFD
3constant F_GETFD
4constant F_SETFD
5constant F_GETFL
6constant F_SETFL
7constant F_GETLK
8constant F_SETLK
9constant F_SETLKW
10#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98
11constant F_GETOWN
12constant F_SETOWN
13#endif
14
15constant FD_CLOEXEC
16
17constant F_RDLCK
18constant F_UNLCK
19constant F_WRLCK
20
21#if defined POSIX
22allow SEEK_SET
23allow SEEK_CUR
24allow SEEK_END
25#else
26constant SEEK_SET
27constant SEEK_CUR
28constant SEEK_END
29#endif
30
31constant O_CREAT
32constant O_EXCL
33constant O_NOCTTY
34constant O_TRUNC
35
36constant O_APPEND
37constant O_NONBLOCK
38constant O_SYNC
39#if !defined XPG4 && !defined XPG42
40constant O_DSYNC
41constant O_RSYNC
42#endif
43
44constant O_ACCMODE
45
46constant O_RDONLY
47constant O_RDWR
48constant O_WRONLY
49
50#if !defined POSIX
51constant S_IRWXU
52constant S_IRUSR
53constant S_IWUSR
54constant S_IXUSR
55constant S_IRWXG
56constant S_IRGRP
57constant S_IWGRP
58constant S_IXGRP
59constant S_IRWXO
60constant S_IROTH
61constant S_IWOTH
62constant S_IXOTH
63constant S_ISUID
64constant S_ISGID
65#if !defined POSIX2008
66constant S_ISVTX
67#endif
68#endif
69
70#if defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008
71constant POSIX_FADV_NORMAL
72constant POSIX_FADV_SEQUENTIAL
73constant POSIX_FADV_RANDOM
74constant POSIX_FADV_WILLNEED
75constant POSIX_FADV_DONTNEED
76constant POSIX_FADV_NOREUSE
77#endif
78
79type {struct flock}
80
81// Bug 23081: l_type and l_whence members of flock structure have type int instead of short
82xfail[i386-gnu]-element {struct flock} short l_type
83xfail[i386-gnu]-element {struct flock} short l_whence
84element {struct flock} off_t l_start
85element {struct flock} off_t l_len
86element {struct flock} pid_t l_pid
87
88#if !defined POSIX
89# if !defined UNIX98
90type mode_t
91# endif
92type off_t
93type pid_t
94#endif
95
96function int creat (const char*, mode_t)
97function int fcntl (int, int, ...)
98function int open (const char*, int, ...)
99#if defined XOPEN2K8 || defined POSIX2008
100function int openat (int, const char*, int, ...)
101#endif
102#if defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008
103function int posix_fadvise (int, off_t, off_t, int)
104function int posix_fallocate (int, off_t, off_t)
105#endif
106
107#if defined XOPEN2K8 || defined POSIX2008
108// Bug 18228: O_TTY_INIT, O_EXEC, O_SEARCH missing.
109xfail-constant O_TTY_INIT
110constant O_CLOEXEC
111xfail-constant O_EXEC
112xfail-constant O_SEARCH
113constant O_DIRECTORY
114constant O_NOFOLLOW
115constant F_DUPFD_CLOEXEC
116constant AT_FDCWD
117constant AT_EACCESS
118constant AT_SYMLINK_NOFOLLOW
119constant AT_SYMLINK_FOLLOW
120constant AT_REMOVEDIR
121
122function int openat (int, const char*, int, ...)
123#endif
124
125#if !defined POSIX
126allow-header sys/stat.h
127allow-header unistd.h
128#endif
129
130allow l_*
131allow F_*
132allow O_*
133allow S_*
134allow *_t
135#endif
136