dhcpd-pools  3.0
ISC dhcpd lease usage analyser
fcntl.h
Go to the documentation of this file.
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* Like <fcntl.h>, but with non-working flags defined to 0.
3 
4  Copyright (C) 2006-2017 Free Software Foundation, Inc.
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 
19 /* written by Paul Eggert */
20 
21 #if __GNUC__ >= 3
22 #pragma GCC system_header
23 #endif
24 
25 
26 #if defined __need_system_fcntl_h
27 /* Special invocation convention. */
28 
29 /* Needed before <sys/stat.h>.
30  May also define off_t to a 64-bit type on native Windows. */
31 #include <sys/types.h>
32 /* On some systems other than glibc, <sys/stat.h> is a prerequisite of
33  <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
34  But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
35  extern "C" { ... } block, which leads to errors in C++ mode with the
36  overridden <sys/stat.h> from gnulib. These errors are known to be gone
37  with g++ version >= 4.3. */
38 #if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))))
39 # include <sys/stat.h>
40 #endif
41 #include_next <fcntl.h>
42 
43 #else
44 /* Normal invocation convention. */
45 
46 #ifndef _GL_FCNTL_H
47 
48 /* Needed before <sys/stat.h>.
49  May also define off_t to a 64-bit type on native Windows. */
50 #include <sys/types.h>
51 /* On some systems other than glibc, <sys/stat.h> is a prerequisite of
52  <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
53  But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
54  extern "C" { ... } block, which leads to errors in C++ mode with the
55  overridden <sys/stat.h> from gnulib. These errors are known to be gone
56  with g++ version >= 4.3. */
57 #if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))))
58 # include <sys/stat.h>
59 #endif
60 /* The include_next requires a split double-inclusion guard. */
61 #include_next <fcntl.h>
62 
63 #ifndef _GL_FCNTL_H
64 #define _GL_FCNTL_H
65 
66 #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
67 # include <unistd.h>
68 #endif
69 
70 /* Native Windows platforms declare open(), creat() in <io.h>. */
71 #if (0 || defined GNULIB_POSIXCHECK) \
72  && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
73 # include <io.h>
74 #endif
75 
76 
77 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
78 /* C++ compatible function declaration macros.
79  Copyright (C) 2010-2017 Free Software Foundation, Inc.
80 
81  This program is free software: you can redistribute it and/or modify it
82  under the terms of the GNU General Public License as published
83  by the Free Software Foundation; either version 3 of the License, or
84  (at your option) any later version.
85 
86  This program is distributed in the hope that it will be useful,
87  but WITHOUT ANY WARRANTY; without even the implied warranty of
88  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
89  General Public License for more details.
90 
91  You should have received a copy of the GNU General Public License
92  along with this program. If not, see <https://www.gnu.org/licenses/>. */
93 
94 #ifndef _GL_CXXDEFS_H
95 #define _GL_CXXDEFS_H
96 
97 /* Begin/end the GNULIB_NAMESPACE namespace. */
98 #if defined __cplusplus && defined GNULIB_NAMESPACE
99 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
100 # define _GL_END_NAMESPACE }
101 #else
102 # define _GL_BEGIN_NAMESPACE
103 # define _GL_END_NAMESPACE
104 #endif
105 
106 /* The three most frequent use cases of these macros are:
107 
108  * For providing a substitute for a function that is missing on some
109  platforms, but is declared and works fine on the platforms on which
110  it exists:
111 
112  #if @GNULIB_FOO@
113  # if !@HAVE_FOO@
114  _GL_FUNCDECL_SYS (foo, ...);
115  # endif
116  _GL_CXXALIAS_SYS (foo, ...);
117  _GL_CXXALIASWARN (foo);
118  #elif defined GNULIB_POSIXCHECK
119  ...
120  #endif
121 
122  * For providing a replacement for a function that exists on all platforms,
123  but is broken/insufficient and needs to be replaced on some platforms:
124 
125  #if @GNULIB_FOO@
126  # if @REPLACE_FOO@
127  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
128  # undef foo
129  # define foo rpl_foo
130  # endif
131  _GL_FUNCDECL_RPL (foo, ...);
132  _GL_CXXALIAS_RPL (foo, ...);
133  # else
134  _GL_CXXALIAS_SYS (foo, ...);
135  # endif
136  _GL_CXXALIASWARN (foo);
137  #elif defined GNULIB_POSIXCHECK
138  ...
139  #endif
140 
141  * For providing a replacement for a function that exists on some platforms
142  but is broken/insufficient and needs to be replaced on some of them and
143  is additionally either missing or undeclared on some other platforms:
144 
145  #if @GNULIB_FOO@
146  # if @REPLACE_FOO@
147  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
148  # undef foo
149  # define foo rpl_foo
150  # endif
151  _GL_FUNCDECL_RPL (foo, ...);
152  _GL_CXXALIAS_RPL (foo, ...);
153  # else
154  # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
155  _GL_FUNCDECL_SYS (foo, ...);
156  # endif
157  _GL_CXXALIAS_SYS (foo, ...);
158  # endif
159  _GL_CXXALIASWARN (foo);
160  #elif defined GNULIB_POSIXCHECK
161  ...
162  #endif
163 */
164 
165 /* _GL_EXTERN_C declaration;
166  performs the declaration with C linkage. */
167 #if defined __cplusplus
168 # define _GL_EXTERN_C extern "C"
169 #else
170 # define _GL_EXTERN_C extern
171 #endif
172 
173 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
174  declares a replacement function, named rpl_func, with the given prototype,
175  consisting of return type, parameters, and attributes.
176  Example:
177  _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
178  _GL_ARG_NONNULL ((1)));
179  */
180 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
181  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
182 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
183  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
184 
185 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
186  declares the system function, named func, with the given prototype,
187  consisting of return type, parameters, and attributes.
188  Example:
189  _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
190  _GL_ARG_NONNULL ((1)));
191  */
192 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
193  _GL_EXTERN_C rettype func parameters_and_attributes
194 
195 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
196  declares a C++ alias called GNULIB_NAMESPACE::func
197  that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
198  Example:
199  _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
200 
201  Wrapping rpl_func in an object with an inline conversion operator
202  avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
203  actually used in the program. */
204 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
205  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
206 #if defined __cplusplus && defined GNULIB_NAMESPACE
207 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
208  namespace GNULIB_NAMESPACE \
209  { \
210  static const struct _gl_ ## func ## _wrapper \
211  { \
212  typedef rettype (*type) parameters; \
213  \
214  inline operator type () const \
215  { \
216  return ::rpl_func; \
217  } \
218  } func = {}; \
219  } \
220  _GL_EXTERN_C int _gl_cxxalias_dummy
221 #else
222 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
223  _GL_EXTERN_C int _gl_cxxalias_dummy
224 #endif
225 
226 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
227  is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
228  except that the C function rpl_func may have a slightly different
229  declaration. A cast is used to silence the "invalid conversion" error
230  that would otherwise occur. */
231 #if defined __cplusplus && defined GNULIB_NAMESPACE
232 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
233  namespace GNULIB_NAMESPACE \
234  { \
235  static const struct _gl_ ## func ## _wrapper \
236  { \
237  typedef rettype (*type) parameters; \
238  \
239  inline operator type () const \
240  { \
241  return reinterpret_cast<type>(::rpl_func); \
242  } \
243  } func = {}; \
244  } \
245  _GL_EXTERN_C int _gl_cxxalias_dummy
246 #else
247 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
248  _GL_EXTERN_C int _gl_cxxalias_dummy
249 #endif
250 
251 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
252  declares a C++ alias called GNULIB_NAMESPACE::func
253  that redirects to the system provided function func, if GNULIB_NAMESPACE
254  is defined.
255  Example:
256  _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
257 
258  Wrapping func in an object with an inline conversion operator
259  avoids a reference to func unless GNULIB_NAMESPACE::func is
260  actually used in the program. */
261 #if defined __cplusplus && defined GNULIB_NAMESPACE
262 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
263  namespace GNULIB_NAMESPACE \
264  { \
265  static const struct _gl_ ## func ## _wrapper \
266  { \
267  typedef rettype (*type) parameters; \
268  \
269  inline operator type () const \
270  { \
271  return ::func; \
272  } \
273  } func = {}; \
274  } \
275  _GL_EXTERN_C int _gl_cxxalias_dummy
276 #else
277 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
278  _GL_EXTERN_C int _gl_cxxalias_dummy
279 #endif
280 
281 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
282  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
283  except that the C function func may have a slightly different declaration.
284  A cast is used to silence the "invalid conversion" error that would
285  otherwise occur. */
286 #if defined __cplusplus && defined GNULIB_NAMESPACE
287 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
288  namespace GNULIB_NAMESPACE \
289  { \
290  static const struct _gl_ ## func ## _wrapper \
291  { \
292  typedef rettype (*type) parameters; \
293  \
294  inline operator type () const \
295  { \
296  return reinterpret_cast<type>(::func); \
297  } \
298  } func = {}; \
299  } \
300  _GL_EXTERN_C int _gl_cxxalias_dummy
301 #else
302 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
303  _GL_EXTERN_C int _gl_cxxalias_dummy
304 #endif
305 
306 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
307  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
308  except that the C function is picked among a set of overloaded functions,
309  namely the one with rettype2 and parameters2. Two consecutive casts
310  are used to silence the "cannot find a match" and "invalid conversion"
311  errors that would otherwise occur. */
312 #if defined __cplusplus && defined GNULIB_NAMESPACE
313  /* The outer cast must be a reinterpret_cast.
314  The inner cast: When the function is defined as a set of overloaded
315  functions, it works as a static_cast<>, choosing the designated variant.
316  When the function is defined as a single variant, it works as a
317  reinterpret_cast<>. The parenthesized cast syntax works both ways. */
318 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
319  namespace GNULIB_NAMESPACE \
320  { \
321  static const struct _gl_ ## func ## _wrapper \
322  { \
323  typedef rettype (*type) parameters; \
324  \
325  inline operator type () const \
326  { \
327  return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
328  } \
329  } func = {}; \
330  } \
331  _GL_EXTERN_C int _gl_cxxalias_dummy
332 #else
333 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
334  _GL_EXTERN_C int _gl_cxxalias_dummy
335 #endif
336 
337 /* _GL_CXXALIASWARN (func);
338  causes a warning to be emitted when ::func is used but not when
339  GNULIB_NAMESPACE::func is used. func must be defined without overloaded
340  variants. */
341 #if defined __cplusplus && defined GNULIB_NAMESPACE
342 # define _GL_CXXALIASWARN(func) \
343  _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
344 # define _GL_CXXALIASWARN_1(func,namespace) \
345  _GL_CXXALIASWARN_2 (func, namespace)
346 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
347  we enable the warning only when not optimizing. */
348 # if !__OPTIMIZE__
349 # define _GL_CXXALIASWARN_2(func,namespace) \
350  _GL_WARN_ON_USE (func, \
351  "The symbol ::" #func " refers to the system function. " \
352  "Use " #namespace "::" #func " instead.")
353 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
354 # define _GL_CXXALIASWARN_2(func,namespace) \
355  extern __typeof__ (func) func
356 # else
357 # define _GL_CXXALIASWARN_2(func,namespace) \
358  _GL_EXTERN_C int _gl_cxxalias_dummy
359 # endif
360 #else
361 # define _GL_CXXALIASWARN(func) \
362  _GL_EXTERN_C int _gl_cxxalias_dummy
363 #endif
364 
365 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
366  causes a warning to be emitted when the given overloaded variant of ::func
367  is used but not when GNULIB_NAMESPACE::func is used. */
368 #if defined __cplusplus && defined GNULIB_NAMESPACE
369 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
370  _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
371  GNULIB_NAMESPACE)
372 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
373  _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
374 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
375  we enable the warning only when not optimizing. */
376 # if !__OPTIMIZE__
377 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
378  _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
379  "The symbol ::" #func " refers to the system function. " \
380  "Use " #namespace "::" #func " instead.")
381 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
382 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
383  extern __typeof__ (func) func
384 # else
385 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
386  _GL_EXTERN_C int _gl_cxxalias_dummy
387 # endif
388 #else
389 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
390  _GL_EXTERN_C int _gl_cxxalias_dummy
391 #endif
392 
393 #endif /* _GL_CXXDEFS_H */
394 
395 /* The definition of _GL_ARG_NONNULL is copied here. */
396 /* A C macro for declaring that specific arguments must not be NULL.
397  Copyright (C) 2009-2017 Free Software Foundation, Inc.
398 
399  This program is free software: you can redistribute it and/or modify it
400  under the terms of the GNU General Public License as published
401  by the Free Software Foundation; either version 3 of the License, or
402  (at your option) any later version.
403 
404  This program is distributed in the hope that it will be useful,
405  but WITHOUT ANY WARRANTY; without even the implied warranty of
406  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
407  General Public License for more details.
408 
409  You should have received a copy of the GNU General Public License
410  along with this program. If not, see <https://www.gnu.org/licenses/>. */
411 
412 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
413  that the values passed as arguments n, ..., m must be non-NULL pointers.
414  n = 1 stands for the first argument, n = 2 for the second argument etc. */
415 #ifndef _GL_ARG_NONNULL
416 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
417 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
418 # else
419 # define _GL_ARG_NONNULL(params)
420 # endif
421 #endif
422 
423 /* The definition of _GL_WARN_ON_USE is copied here. */
424 /* A C macro for emitting warnings if a function is used.
425  Copyright (C) 2010-2017 Free Software Foundation, Inc.
426 
427  This program is free software: you can redistribute it and/or modify it
428  under the terms of the GNU General Public License as published
429  by the Free Software Foundation; either version 3 of the License, or
430  (at your option) any later version.
431 
432  This program is distributed in the hope that it will be useful,
433  but WITHOUT ANY WARRANTY; without even the implied warranty of
434  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
435  General Public License for more details.
436 
437  You should have received a copy of the GNU General Public License
438  along with this program. If not, see <https://www.gnu.org/licenses/>. */
439 
440 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
441  for FUNCTION which will then trigger a compiler warning containing
442  the text of "literal string" anywhere that function is called, if
443  supported by the compiler. If the compiler does not support this
444  feature, the macro expands to an unused extern declaration.
445 
446  This macro is useful for marking a function as a potential
447  portability trap, with the intent that "literal string" include
448  instructions on the replacement function that should be used
449  instead. However, one of the reasons that a function is a
450  portability trap is if it has the wrong signature. Declaring
451  FUNCTION with a different signature in C is a compilation error, so
452  this macro must use the same type as any existing declaration so
453  that programs that avoid the problematic FUNCTION do not fail to
454  compile merely because they included a header that poisoned the
455  function. But this implies that _GL_WARN_ON_USE is only safe to
456  use if FUNCTION is known to already have a declaration. Use of
457  this macro implies that there must not be any other macro hiding
458  the declaration of FUNCTION; but undefining FUNCTION first is part
459  of the poisoning process anyway (although for symbols that are
460  provided only via a macro, the result is a compilation error rather
461  than a warning containing "literal string"). Also note that in
462  C++, it is only safe to use if FUNCTION has no overloads.
463 
464  For an example, it is possible to poison 'getline' by:
465  - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
466  [getline]) in configure.ac, which potentially defines
467  HAVE_RAW_DECL_GETLINE
468  - adding this code to a header that wraps the system <stdio.h>:
469  #undef getline
470  #if HAVE_RAW_DECL_GETLINE
471  _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
472  "not universally present; use the gnulib module getline");
473  #endif
474 
475  It is not possible to directly poison global variables. But it is
476  possible to write a wrapper accessor function, and poison that
477  (less common usage, like &environ, will cause a compilation error
478  rather than issue the nice warning, but the end result of informing
479  the developer about their portability problem is still achieved):
480  #if HAVE_RAW_DECL_ENVIRON
481  static char ***rpl_environ (void) { return &environ; }
482  _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
483  # undef environ
484  # define environ (*rpl_environ ())
485  #endif
486  */
487 #ifndef _GL_WARN_ON_USE
488 
489 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
490 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
491 # define _GL_WARN_ON_USE(function, message) \
492 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
493 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
494 /* Verify the existence of the function. */
495 # define _GL_WARN_ON_USE(function, message) \
496 extern __typeof__ (function) function
497 # else /* Unsupported. */
498 # define _GL_WARN_ON_USE(function, message) \
499 _GL_WARN_EXTERN_C int _gl_warn_on_use
500 # endif
501 #endif
502 
503 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
504  is like _GL_WARN_ON_USE (function, "string"), except that the function is
505  declared with the given prototype, consisting of return type, parameters,
506  and attributes.
507  This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
508  not work in this case. */
509 #ifndef _GL_WARN_ON_USE_CXX
510 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
511 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
512 extern rettype function parameters_and_attributes \
513  __attribute__ ((__warning__ (msg)))
514 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
515 /* Verify the existence of the function. */
516 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
517 extern rettype function parameters_and_attributes
518 # else /* Unsupported. */
519 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
520 _GL_WARN_EXTERN_C int _gl_warn_on_use
521 # endif
522 #endif
523 
524 /* _GL_WARN_EXTERN_C declaration;
525  performs the declaration with C linkage. */
526 #ifndef _GL_WARN_EXTERN_C
527 # if defined __cplusplus
528 # define _GL_WARN_EXTERN_C extern "C"
529 # else
530 # define _GL_WARN_EXTERN_C extern
531 # endif
532 #endif
533 
534 
535 /* Declare overridden functions. */
536 
537 #if 0
538 # if 0
539 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
540 # undef fcntl
541 # define fcntl rpl_fcntl
542 # endif
543 _GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
544 _GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
545 # else
546 # if !1
547 _GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
548 # endif
549 _GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
550 # endif
551 _GL_CXXALIASWARN (fcntl);
552 #elif defined GNULIB_POSIXCHECK
553 # undef fcntl
554 # if HAVE_RAW_DECL_FCNTL
555 _GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
556  "use gnulib module fcntl for portability");
557 # endif
558 #endif
559 
560 #if 0
561 # if 0
562 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
563 # undef open
564 # define open rpl_open
565 # endif
566 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
567  _GL_ARG_NONNULL ((1)));
568 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
569 # else
570 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
571 # endif
572 /* On HP-UX 11, in C++ mode, open() is defined as an inline function with a
573  default argument. _GL_CXXALIASWARN does not work in this case. */
574 # if !defined __hpux
575 _GL_CXXALIASWARN (open);
576 # endif
577 #elif defined GNULIB_POSIXCHECK
578 # undef open
579 /* Assume open is always declared. */
580 _GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
581  "use gnulib module open for portability");
582 #endif
583 
584 #if 0
585 # if 0
586 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
587 # undef openat
588 # define openat rpl_openat
589 # endif
590 _GL_FUNCDECL_RPL (openat, int,
591  (int fd, char const *file, int flags, /* mode_t mode */ ...)
592  _GL_ARG_NONNULL ((2)));
593 _GL_CXXALIAS_RPL (openat, int,
594  (int fd, char const *file, int flags, /* mode_t mode */ ...));
595 # else
596 # if !1
597 _GL_FUNCDECL_SYS (openat, int,
598  (int fd, char const *file, int flags, /* mode_t mode */ ...)
599  _GL_ARG_NONNULL ((2)));
600 # endif
601 _GL_CXXALIAS_SYS (openat, int,
602  (int fd, char const *file, int flags, /* mode_t mode */ ...));
603 # endif
604 _GL_CXXALIASWARN (openat);
605 #elif defined GNULIB_POSIXCHECK
606 # undef openat
607 # if HAVE_RAW_DECL_OPENAT
608 _GL_WARN_ON_USE (openat, "openat is not portable - "
609  "use gnulib module openat for portability");
610 # endif
611 #endif
612 
613 
614 /* Fix up the FD_* macros, only known to be missing on mingw. */
615 
616 #ifndef FD_CLOEXEC
617 # define FD_CLOEXEC 1
618 #endif
619 
620 /* Fix up the supported F_* macros. Intentionally leave other F_*
621  macros undefined. Only known to be missing on mingw. */
622 
623 #ifndef F_DUPFD_CLOEXEC
624 # define F_DUPFD_CLOEXEC 0x40000000
625 /* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise. */
626 # define GNULIB_defined_F_DUPFD_CLOEXEC 1
627 #else
628 # define GNULIB_defined_F_DUPFD_CLOEXEC 0
629 #endif
630 
631 #ifndef F_DUPFD
632 # define F_DUPFD 1
633 #endif
634 
635 #ifndef F_GETFD
636 # define F_GETFD 2
637 #endif
638 
639 /* Fix up the O_* macros. */
640 
641 /* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT
642  to values outside 'int' range, so omit these misdefinitions.
643  But avoid namespace pollution on non-AIX systems. */
644 #ifdef _AIX
645 # include <limits.h>
646 # if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX)
647 # undef O_CLOEXEC
648 # endif
649 # if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX)
650 # undef O_NOFOLLOW
651 # endif
652 # if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX)
653 # undef O_TTY_INIT
654 # endif
655 #endif
656 
657 #if !defined O_DIRECT && defined O_DIRECTIO
658 /* Tru64 spells it 'O_DIRECTIO'. */
659 # define O_DIRECT O_DIRECTIO
660 #endif
661 
662 #if !defined O_CLOEXEC && defined O_NOINHERIT
663 /* Mingw spells it 'O_NOINHERIT'. */
664 # define O_CLOEXEC O_NOINHERIT
665 #endif
666 
667 #ifndef O_CLOEXEC
668 # define O_CLOEXEC 0x40000000 /* Try to not collide with system O_* flags. */
669 # define GNULIB_defined_O_CLOEXEC 1
670 #else
671 # define GNULIB_defined_O_CLOEXEC 0
672 #endif
673 
674 #ifndef O_DIRECT
675 # define O_DIRECT 0
676 #endif
677 
678 #ifndef O_DIRECTORY
679 # define O_DIRECTORY 0
680 #endif
681 
682 #ifndef O_DSYNC
683 # define O_DSYNC 0
684 #endif
685 
686 #ifndef O_EXEC
687 # define O_EXEC O_RDONLY /* This is often close enough in older systems. */
688 #endif
689 
690 #ifndef O_IGNORE_CTTY
691 # define O_IGNORE_CTTY 0
692 #endif
693 
694 #ifndef O_NDELAY
695 # define O_NDELAY 0
696 #endif
697 
698 #ifndef O_NOATIME
699 # define O_NOATIME 0
700 #endif
701 
702 #ifndef O_NONBLOCK
703 # define O_NONBLOCK O_NDELAY
704 #endif
705 
706 /* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero
707  value of O_NONBLOCK. Otherwise, O_NONBLOCK is defined (above) to O_NDELAY
708  or to 0 as fallback. */
709 #if 0
710 # if O_NONBLOCK
711 # define GNULIB_defined_O_NONBLOCK 0
712 # else
713 # define GNULIB_defined_O_NONBLOCK 1
714 # undef O_NONBLOCK
715 # define O_NONBLOCK 0x40000000
716 # endif
717 #endif
718 
719 #ifndef O_NOCTTY
720 # define O_NOCTTY 0
721 #endif
722 
723 #ifndef O_NOFOLLOW
724 # define O_NOFOLLOW 0
725 #endif
726 
727 #ifndef O_NOLINK
728 # define O_NOLINK 0
729 #endif
730 
731 #ifndef O_NOLINKS
732 # define O_NOLINKS 0
733 #endif
734 
735 #ifndef O_NOTRANS
736 # define O_NOTRANS 0
737 #endif
738 
739 #ifndef O_RSYNC
740 # define O_RSYNC 0
741 #endif
742 
743 #ifndef O_SEARCH
744 # define O_SEARCH O_RDONLY /* This is often close enough in older systems. */
745 #endif
746 
747 #ifndef O_SYNC
748 # define O_SYNC 0
749 #endif
750 
751 #ifndef O_TTY_INIT
752 # define O_TTY_INIT 0
753 #endif
754 
755 #if ~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
756 # undef O_ACCMODE
757 # define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
758 #endif
759 
760 /* For systems that distinguish between text and binary I/O.
761  O_BINARY is usually declared in fcntl.h */
762 #if !defined O_BINARY && defined _O_BINARY
763  /* For MSC-compatible compilers. */
764 # define O_BINARY _O_BINARY
765 # define O_TEXT _O_TEXT
766 #endif
767 
768 #if defined __BEOS__ || defined __HAIKU__
769  /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
770 # undef O_BINARY
771 # undef O_TEXT
772 #endif
773 
774 #ifndef O_BINARY
775 # define O_BINARY 0
776 # define O_TEXT 0
777 #endif
778 
779 /* Fix up the AT_* macros. */
780 
781 /* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
782  value exceeds INT_MAX, so its use as an int doesn't conform to the
783  C standard, and GCC and Sun C complain in some cases. If the bug
784  is present, undef AT_FDCWD here, so it can be redefined below. */
785 #if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
786 # undef AT_FDCWD
787 #endif
788 
789 /* Use the same bit pattern as Solaris 9, but with the proper
790  signedness. The bit pattern is important, in case this actually is
791  Solaris with the above workaround. */
792 #ifndef AT_FDCWD
793 # define AT_FDCWD (-3041965)
794 #endif
795 
796 /* Use the same values as Solaris 9. This shouldn't matter, but
797  there's no real reason to differ. */
798 #ifndef AT_SYMLINK_NOFOLLOW
799 # define AT_SYMLINK_NOFOLLOW 4096
800 #endif
801 
802 #ifndef AT_REMOVEDIR
803 # define AT_REMOVEDIR 1
804 #endif
805 
806 /* Solaris 9 lacks these two, so just pick unique values. */
807 #ifndef AT_SYMLINK_FOLLOW
808 # define AT_SYMLINK_FOLLOW 2
809 #endif
810 
811 #ifndef AT_EACCESS
812 # define AT_EACCESS 4
813 #endif
814 
815 
816 #endif /* _GL_FCNTL_H */
817 #endif /* _GL_FCNTL_H */
818 #endif
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: fcntl.h:277
#define _GL_WARN_ON_USE(function, message)
Definition: fcntl.h:498
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: fcntl.h:204
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: fcntl.h:192
#define _GL_ARG_NONNULL(params)
Definition: fcntl.h:419
#define _GL_CXXALIASWARN(func)
Definition: fcntl.h:361
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: fcntl.h:180