]> git.cworth.org Git - tar/blob - gnu/fcntl.in.h
Imported Upstream version 1.24
[tar] / gnu / fcntl.in.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Like <fcntl.h>, but with non-working flags defined to 0.
4
5    Copyright (C) 2006-2010 Free Software Foundation, Inc.
6
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
20 /* written by Paul Eggert */
21
22 #if __GNUC__ >= 3
23 @PRAGMA_SYSTEM_HEADER@
24 #endif
25 @PRAGMA_COLUMNS@
26
27 #if defined __need_system_fcntl_h
28 /* Special invocation convention.  */
29
30 #include <sys/types.h>
31 #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems.  */
32 # include <sys/stat.h>
33 #endif
34 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
35
36 #else
37 /* Normal invocation convention.  */
38
39 #ifndef _GL_FCNTL_H
40
41 #include <sys/types.h>
42 #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems.  */
43 # include <sys/stat.h>
44 #endif
45 /* The include_next requires a split double-inclusion guard.  */
46 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
47
48 #ifndef _GL_FCNTL_H
49 #define _GL_FCNTL_H
50
51 #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems.  */
52 # include <unistd.h>
53 #endif
54
55
56 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
57
58 /* The definition of _GL_ARG_NONNULL is copied here.  */
59
60 /* The definition of _GL_WARN_ON_USE is copied here.  */
61
62
63 /* Declare overridden functions.  */
64
65 #if @GNULIB_FCNTL@
66 # if @REPLACE_FCNTL@
67 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
68 #   undef fcntl
69 #   define fcntl rpl_fcntl
70 #  endif
71 _GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
72 _GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
73 # else
74 #  if !@HAVE_FCNTL@
75 _GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
76 #  endif
77 _GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
78 # endif
79 _GL_CXXALIASWARN (fcntl);
80 #elif defined GNULIB_POSIXCHECK
81 # undef fcntl
82 # if HAVE_RAW_DECL_FCNTL
83 _GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
84                  "use gnulib module fcntl for portability");
85 # endif
86 #endif
87
88 #if @GNULIB_OPEN@
89 # if @REPLACE_OPEN@
90 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
91 #   undef open
92 #   define open rpl_open
93 #  endif
94 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
95                              _GL_ARG_NONNULL ((1)));
96 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
97 # else
98 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
99 # endif
100 _GL_CXXALIASWARN (open);
101 #elif defined GNULIB_POSIXCHECK
102 # undef open
103 /* Assume open is always declared.  */
104 _GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
105                  "use gnulib module open for portability");
106 #endif
107
108 #if @GNULIB_OPENAT@
109 # if @REPLACE_OPENAT@
110 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
111 #   undef openat
112 #   define openat rpl_openat
113 #  endif
114 _GL_FUNCDECL_RPL (openat, int,
115                   (int fd, char const *file, int flags, /* mode_t mode */ ...)
116                   _GL_ARG_NONNULL ((2)));
117 _GL_CXXALIAS_RPL (openat, int,
118                   (int fd, char const *file, int flags, /* mode_t mode */ ...));
119 # else
120 #  if !@HAVE_OPENAT@
121 _GL_FUNCDECL_SYS (openat, int,
122                   (int fd, char const *file, int flags, /* mode_t mode */ ...)
123                   _GL_ARG_NONNULL ((2)));
124 #  endif
125 _GL_CXXALIAS_SYS (openat, int,
126                   (int fd, char const *file, int flags, /* mode_t mode */ ...));
127 # endif
128 _GL_CXXALIASWARN (openat);
129 #elif defined GNULIB_POSIXCHECK
130 # undef openat
131 # if HAVE_RAW_DECL_OPENAT
132 _GL_WARN_ON_USE (openat, "openat is not portable - "
133                  "use gnulib module openat for portability");
134 # endif
135 #endif
136
137
138 /* Fix up the FD_* macros, only known to be missing on mingw.  */
139
140 #ifndef FD_CLOEXEC
141 # define FD_CLOEXEC 1
142 #endif
143
144 /* Fix up the supported F_* macros.  Intentionally leave other F_*
145    macros undefined.  Only known to be missing on mingw.  */
146
147 #ifndef F_DUPFD_CLOEXEC
148 # define F_DUPFD_CLOEXEC 0x40000000
149 /* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise.  */
150 # define GNULIB_defined_F_DUPFD_CLOEXEC 1
151 #else
152 # define GNULIB_defined_F_DUPFD_CLOEXEC 0
153 #endif
154
155 #ifndef F_DUPFD
156 # define F_DUPFD 1
157 #endif
158
159 #ifndef F_GETFD
160 # define F_GETFD 2
161 #endif
162
163 /* Fix up the O_* macros.  */
164
165 #if !defined O_DIRECT && defined O_DIRECTIO
166 /* Tru64 spells it `O_DIRECTIO'.  */
167 # define O_DIRECT O_DIRECTIO
168 #endif
169
170 #if !defined O_CLOEXEC && defined O_NOINHERIT
171 /* Mingw spells it `O_NOINHERIT'.  Intentionally leave it
172    undefined if not available.  */
173 # define O_CLOEXEC O_NOINHERIT
174 #endif
175
176 #ifndef O_CLOEXEC
177 # define O_CLOEXEC 0
178 #endif
179
180 #ifndef O_DIRECT
181 # define O_DIRECT 0
182 #endif
183
184 #ifndef O_DIRECTORY
185 # define O_DIRECTORY 0
186 #endif
187
188 #ifndef O_DSYNC
189 # define O_DSYNC 0
190 #endif
191
192 #ifndef O_EXEC
193 # define O_EXEC O_RDONLY /* This is often close enough in older systems.  */
194 #endif
195
196 #ifndef O_NDELAY
197 # define O_NDELAY 0
198 #endif
199
200 #ifndef O_NOATIME
201 # define O_NOATIME 0
202 #endif
203
204 #ifndef O_NONBLOCK
205 # define O_NONBLOCK O_NDELAY
206 #endif
207
208 #ifndef O_NOCTTY
209 # define O_NOCTTY 0
210 #endif
211
212 #ifndef O_NOFOLLOW
213 # define O_NOFOLLOW 0
214 #endif
215
216 #ifndef O_NOLINKS
217 # define O_NOLINKS 0
218 #endif
219
220 #ifndef O_RSYNC
221 # define O_RSYNC 0
222 #endif
223
224 #ifndef O_SEARCH
225 # define O_SEARCH O_RDONLY /* This is often close enough in older systems.  */
226 #endif
227
228 #ifndef O_SYNC
229 # define O_SYNC 0
230 #endif
231
232 #ifndef O_TTY_INIT
233 # define O_TTY_INIT 0
234 #endif
235
236 /* For systems that distinguish between text and binary I/O.
237    O_BINARY is usually declared in fcntl.h  */
238 #if !defined O_BINARY && defined _O_BINARY
239   /* For MSC-compatible compilers.  */
240 # define O_BINARY _O_BINARY
241 # define O_TEXT _O_TEXT
242 #endif
243
244 #if defined __BEOS__ || defined __HAIKU__
245   /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect.  */
246 # undef O_BINARY
247 # undef O_TEXT
248 #endif
249
250 #ifndef O_BINARY
251 # define O_BINARY 0
252 # define O_TEXT 0
253 #endif
254
255 /* Fix up the AT_* macros.  */
256
257 /* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive.  Its
258    value exceeds INT_MAX, so its use as an int doesn't conform to the
259    C standard, and GCC and Sun C complain in some cases.  If the bug
260    is present, undef AT_FDCWD here, so it can be redefined below.  */
261 #if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
262 # undef AT_FDCWD
263 #endif
264
265 /* Use the same bit pattern as Solaris 9, but with the proper
266    signedness.  The bit pattern is important, in case this actually is
267    Solaris with the above workaround.  */
268 #ifndef AT_FDCWD
269 # define AT_FDCWD (-3041965)
270 #endif
271
272 /* Use the same values as Solaris 9.  This shouldn't matter, but
273    there's no real reason to differ.  */
274 #ifndef AT_SYMLINK_NOFOLLOW
275 # define AT_SYMLINK_NOFOLLOW 4096
276 #endif
277
278 #ifndef AT_REMOVEDIR
279 # define AT_REMOVEDIR 1
280 #endif
281
282 /* Solaris 9 lacks these two, so just pick unique values.  */
283 #ifndef AT_SYMLINK_FOLLOW
284 # define AT_SYMLINK_FOLLOW 2
285 #endif
286
287 #ifndef AT_EACCESS
288 # define AT_EACCESS 4
289 #endif
290
291
292 #endif /* _GL_FCNTL_H */
293 #endif /* _GL_FCNTL_H */
294 #endif