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