xref: /Universal-ctags/win32/gnulib_h/unistd.h (revision a5d10cd40cb5f3b4d2ab78aaa53944366ab48532)
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* Substitute for and wrapper around <unistd.h>.
3    Copyright (C) 2003-2021 Free Software Foundation, Inc.
4 
5    This file is free software: you can redistribute it and/or modify
6    it under the terms of the GNU Lesser General Public License as
7    published by the Free Software Foundation; either version 2.1 of the
8    License, or (at your option) any later version.
9 
10    This file is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU Lesser General Public License for more details.
14 
15    You should have received a copy of the GNU Lesser General Public License
16    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
17 
18 #ifndef _GL_UNISTD_H
19 
20 #if __GNUC__ >= 3
21 #pragma GCC system_header
22 #endif
23 
24 
25 #if 1 && defined _GL_INCLUDING_UNISTD_H
26 /* Special invocation convention:
27    - On Mac OS X 10.3.9 we have a sequence of nested includes
28      <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h>
29      In this situation, the functions are not yet declared, therefore we cannot
30      provide the C++ aliases.  */
31 
32 #include_next <unistd.h>
33 
34 #else
35 /* Normal invocation convention.  */
36 
37 /* The include_next requires a split double-inclusion guard.  */
38 #if 1
39 # define _GL_INCLUDING_UNISTD_H
40 # include_next <unistd.h>
41 # undef _GL_INCLUDING_UNISTD_H
42 #endif
43 
44 /* Get all possible declarations of gethostname().  */
45 #if 0 && 0 \
46   && !defined _GL_INCLUDING_WINSOCK2_H
47 # define _GL_INCLUDING_WINSOCK2_H
48 # include <winsock2.h>
49 # undef _GL_INCLUDING_WINSOCK2_H
50 #endif
51 
52 #if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
53 #define _GL_UNISTD_H
54 
55 /* NetBSD 5.0 mis-defines NULL.  Also get size_t.  */
56 /* But avoid namespace pollution on glibc systems.  */
57 #ifndef __GLIBC__
58 # include <stddef.h>
59 #endif
60 
61 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>.  */
62 /* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>.  We must include
63    it before we  #define unlink rpl_unlink.  */
64 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>.  */
65 /* But avoid namespace pollution on glibc systems.  */
66 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
67      || ((0 || defined GNULIB_POSIXCHECK) \
68          && (defined _WIN32 && ! defined __CYGWIN__)) \
69      || ((0 || defined GNULIB_POSIXCHECK) \
70          && defined __CYGWIN__)) \
71     && ! defined __GLIBC__
72 # include <stdio.h>
73 #endif
74 
75 /* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in
76    <unistd.h>.  */
77 /* But avoid namespace pollution on glibc systems.  */
78 #if (0 || defined GNULIB_POSIXCHECK) \
79     && (defined __CYGWIN__ || defined __ANDROID__) \
80     && ! defined __GLIBC__
81 # include <fcntl.h>
82 #endif
83 
84 /* mingw fails to declare _exit in <unistd.h>.  */
85 /* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
86    <unistd.h>.  */
87 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
88 /* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is
89    included here.  */
90 /* But avoid namespace pollution on glibc systems.  */
91 #if !defined __GLIBC__ && !defined __osf__
92 # define __need_system_stdlib_h
93 # include <stdlib.h>
94 # undef __need_system_stdlib_h
95 #endif
96 
97 /* Native Windows platforms declare _chdir, _getcwd, _rmdir in
98    <io.h> and/or <direct.h>, not in <unistd.h>.
99    They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(),
100    _lseek(), _read(), _unlink(), _write() in <io.h>.  */
101 #if defined _WIN32 && !defined __CYGWIN__
102 # include <io.h>
103 # include <direct.h>
104 #endif
105 
106 /* Native Windows platforms declare _execl*, _execv* in <process.h>.  */
107 #if defined _WIN32 && !defined __CYGWIN__
108 # include <process.h>
109 #endif
110 
111 /* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
112    NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>.  */
113 /* But avoid namespace pollution on glibc systems.  */
114 #if ((0 && (defined _AIX || defined __osf__)) \
115      || (0 && defined __TANDEM)) \
116     && !defined __GLIBC__
117 # include <netdb.h>
118 #endif
119 
120 /* Mac OS X 10.13, Solaris 11.4, and Android 9.0 declare getentropy in
121    <sys/random.h>, not in <unistd.h>.  */
122 /* But avoid namespace pollution on glibc systems.  */
123 #if (0 || defined GNULIB_POSIXCHECK) \
124     && ((defined __APPLE__ && defined __MACH__) || defined __sun \
125         || defined __ANDROID__) \
126     && 0 \
127     && !defined __GLIBC__
128 # include <sys/random.h>
129 #endif
130 
131 /* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>.  */
132 /* But avoid namespace pollution on glibc systems.  */
133 #if (0 || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
134     && !defined __GLIBC__
135 # include <sys/stat.h>
136 #endif
137 
138 /* MSVC defines off_t in <sys/types.h>.
139    May also define off_t to a 64-bit type on native Windows.  */
140 /* Get off_t, ssize_t, mode_t.  */
141 #include <sys/types.h>
142 
143 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
144 /* C++ compatible function declaration macros.
145    Copyright (C) 2010-2021 Free Software Foundation, Inc.
146 
147    This program is free software: you can redistribute it and/or modify it
148    under the terms of the GNU Lesser General Public License as published
149    by the Free Software Foundation; either version 2 of the License, or
150    (at your option) any later version.
151 
152    This program is distributed in the hope that it will be useful,
153    but WITHOUT ANY WARRANTY; without even the implied warranty of
154    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
155    Lesser General Public License for more details.
156 
157    You should have received a copy of the GNU Lesser General Public License
158    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
159 
160 #ifndef _GL_CXXDEFS_H
161 #define _GL_CXXDEFS_H
162 
163 /* Begin/end the GNULIB_NAMESPACE namespace.  */
164 #if defined __cplusplus && defined GNULIB_NAMESPACE
165 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
166 # define _GL_END_NAMESPACE }
167 #else
168 # define _GL_BEGIN_NAMESPACE
169 # define _GL_END_NAMESPACE
170 #endif
171 
172 /* The three most frequent use cases of these macros are:
173 
174    * For providing a substitute for a function that is missing on some
175      platforms, but is declared and works fine on the platforms on which
176      it exists:
177 
178        #if @GNULIB_FOO@
179        # if !@HAVE_FOO@
180        _GL_FUNCDECL_SYS (foo, ...);
181        # endif
182        _GL_CXXALIAS_SYS (foo, ...);
183        _GL_CXXALIASWARN (foo);
184        #elif defined GNULIB_POSIXCHECK
185        ...
186        #endif
187 
188    * For providing a replacement for a function that exists on all platforms,
189      but is broken/insufficient and needs to be replaced on some platforms:
190 
191        #if @GNULIB_FOO@
192        # if @REPLACE_FOO@
193        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
194        #   undef foo
195        #   define foo rpl_foo
196        #  endif
197        _GL_FUNCDECL_RPL (foo, ...);
198        _GL_CXXALIAS_RPL (foo, ...);
199        # else
200        _GL_CXXALIAS_SYS (foo, ...);
201        # endif
202        _GL_CXXALIASWARN (foo);
203        #elif defined GNULIB_POSIXCHECK
204        ...
205        #endif
206 
207    * For providing a replacement for a function that exists on some platforms
208      but is broken/insufficient and needs to be replaced on some of them and
209      is additionally either missing or undeclared on some other platforms:
210 
211        #if @GNULIB_FOO@
212        # if @REPLACE_FOO@
213        #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
214        #   undef foo
215        #   define foo rpl_foo
216        #  endif
217        _GL_FUNCDECL_RPL (foo, ...);
218        _GL_CXXALIAS_RPL (foo, ...);
219        # else
220        #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
221        _GL_FUNCDECL_SYS (foo, ...);
222        #  endif
223        _GL_CXXALIAS_SYS (foo, ...);
224        # endif
225        _GL_CXXALIASWARN (foo);
226        #elif defined GNULIB_POSIXCHECK
227        ...
228        #endif
229 */
230 
231 /* _GL_EXTERN_C declaration;
232    performs the declaration with C linkage.  */
233 #if defined __cplusplus
234 # define _GL_EXTERN_C extern "C"
235 #else
236 # define _GL_EXTERN_C extern
237 #endif
238 
239 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
240    declares a replacement function, named rpl_func, with the given prototype,
241    consisting of return type, parameters, and attributes.
242    Example:
243      _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
244                                   _GL_ARG_NONNULL ((1)));
245  */
246 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
247   _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
248 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
249   _GL_EXTERN_C rettype rpl_func parameters_and_attributes
250 
251 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
252    declares the system function, named func, with the given prototype,
253    consisting of return type, parameters, and attributes.
254    Example:
255      _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
256                                   _GL_ARG_NONNULL ((1)));
257  */
258 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
259   _GL_EXTERN_C rettype func parameters_and_attributes
260 
261 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
262    declares a C++ alias called GNULIB_NAMESPACE::func
263    that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
264    Example:
265      _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
266 
267    Wrapping rpl_func in an object with an inline conversion operator
268    avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
269    actually used in the program.  */
270 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
271   _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
272 #if defined __cplusplus && defined GNULIB_NAMESPACE
273 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
274     namespace GNULIB_NAMESPACE                                \
275     {                                                         \
276       static const struct _gl_ ## func ## _wrapper            \
277       {                                                       \
278         typedef rettype (*type) parameters;                   \
279                                                               \
280         inline operator type () const                         \
281         {                                                     \
282           return ::rpl_func;                                  \
283         }                                                     \
284       } func = {};                                            \
285     }                                                         \
286     _GL_EXTERN_C int _gl_cxxalias_dummy
287 #else
288 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
289     _GL_EXTERN_C int _gl_cxxalias_dummy
290 #endif
291 
292 /* _GL_CXXALIAS_MDA (func, rettype, parameters);
293    is to be used when func is a Microsoft deprecated alias, on native Windows.
294    It declares a C++ alias called GNULIB_NAMESPACE::func
295    that redirects to _func, if GNULIB_NAMESPACE is defined.
296    Example:
297      _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
298  */
299 #define _GL_CXXALIAS_MDA(func,rettype,parameters) \
300   _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
301 
302 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
303    is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
304    except that the C function rpl_func may have a slightly different
305    declaration.  A cast is used to silence the "invalid conversion" error
306    that would otherwise occur.  */
307 #if defined __cplusplus && defined GNULIB_NAMESPACE
308 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
309     namespace GNULIB_NAMESPACE                                     \
310     {                                                              \
311       static const struct _gl_ ## func ## _wrapper                 \
312       {                                                            \
313         typedef rettype (*type) parameters;                        \
314                                                                    \
315         inline operator type () const                              \
316         {                                                          \
317           return reinterpret_cast<type>(::rpl_func);               \
318         }                                                          \
319       } func = {};                                                 \
320     }                                                              \
321     _GL_EXTERN_C int _gl_cxxalias_dummy
322 #else
323 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
324     _GL_EXTERN_C int _gl_cxxalias_dummy
325 #endif
326 
327 /* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
328    is like  _GL_CXXALIAS_MDA (func, rettype, parameters);
329    except that the C function func may have a slightly different declaration.
330    A cast is used to silence the "invalid conversion" error that would
331    otherwise occur.  */
332 #define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
333   _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
334 
335 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
336    declares a C++ alias called GNULIB_NAMESPACE::func
337    that redirects to the system provided function func, if GNULIB_NAMESPACE
338    is defined.
339    Example:
340      _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
341 
342    Wrapping func in an object with an inline conversion operator
343    avoids a reference to func unless GNULIB_NAMESPACE::func is
344    actually used in the program.  */
345 #if defined __cplusplus && defined GNULIB_NAMESPACE
346 # define _GL_CXXALIAS_SYS(func,rettype,parameters)            \
347     namespace GNULIB_NAMESPACE                                \
348     {                                                         \
349       static const struct _gl_ ## func ## _wrapper            \
350       {                                                       \
351         typedef rettype (*type) parameters;                   \
352                                                               \
353         inline operator type () const                         \
354         {                                                     \
355           return ::func;                                      \
356         }                                                     \
357       } func = {};                                            \
358     }                                                         \
359     _GL_EXTERN_C int _gl_cxxalias_dummy
360 #else
361 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
362     _GL_EXTERN_C int _gl_cxxalias_dummy
363 #endif
364 
365 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
366    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
367    except that the C function func may have a slightly different declaration.
368    A cast is used to silence the "invalid conversion" error that would
369    otherwise occur.  */
370 #if defined __cplusplus && defined GNULIB_NAMESPACE
371 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
372     namespace GNULIB_NAMESPACE                          \
373     {                                                   \
374       static const struct _gl_ ## func ## _wrapper      \
375       {                                                 \
376         typedef rettype (*type) parameters;             \
377                                                         \
378         inline operator type () const                   \
379         {                                               \
380           return reinterpret_cast<type>(::func);        \
381         }                                               \
382       } func = {};                                      \
383     }                                                   \
384     _GL_EXTERN_C int _gl_cxxalias_dummy
385 #else
386 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
387     _GL_EXTERN_C int _gl_cxxalias_dummy
388 #endif
389 
390 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
391    is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
392    except that the C function is picked among a set of overloaded functions,
393    namely the one with rettype2 and parameters2.  Two consecutive casts
394    are used to silence the "cannot find a match" and "invalid conversion"
395    errors that would otherwise occur.  */
396 #if defined __cplusplus && defined GNULIB_NAMESPACE
397   /* The outer cast must be a reinterpret_cast.
398      The inner cast: When the function is defined as a set of overloaded
399      functions, it works as a static_cast<>, choosing the designated variant.
400      When the function is defined as a single variant, it works as a
401      reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
402 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
403     namespace GNULIB_NAMESPACE                                                \
404     {                                                                         \
405       static const struct _gl_ ## func ## _wrapper                            \
406       {                                                                       \
407         typedef rettype (*type) parameters;                                   \
408                                                                               \
409         inline operator type () const                                         \
410         {                                                                     \
411           return reinterpret_cast<type>((rettype2 (*) parameters2)(::func));  \
412         }                                                                     \
413       } func = {};                                                            \
414     }                                                                         \
415     _GL_EXTERN_C int _gl_cxxalias_dummy
416 #else
417 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
418     _GL_EXTERN_C int _gl_cxxalias_dummy
419 #endif
420 
421 /* _GL_CXXALIASWARN (func);
422    causes a warning to be emitted when ::func is used but not when
423    GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
424    variants.  */
425 #if defined __cplusplus && defined GNULIB_NAMESPACE
426 # define _GL_CXXALIASWARN(func) \
427    _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
428 # define _GL_CXXALIASWARN_1(func,namespace) \
429    _GL_CXXALIASWARN_2 (func, namespace)
430 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
431    we enable the warning only when not optimizing.  */
432 # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
433 #  define _GL_CXXALIASWARN_2(func,namespace) \
434     _GL_WARN_ON_USE (func, \
435                      "The symbol ::" #func " refers to the system function. " \
436                      "Use " #namespace "::" #func " instead.")
437 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
438 #  define _GL_CXXALIASWARN_2(func,namespace) \
439      extern __typeof__ (func) func
440 # else
441 #  define _GL_CXXALIASWARN_2(func,namespace) \
442      _GL_EXTERN_C int _gl_cxxalias_dummy
443 # endif
444 #else
445 # define _GL_CXXALIASWARN(func) \
446     _GL_EXTERN_C int _gl_cxxalias_dummy
447 #endif
448 
449 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
450    causes a warning to be emitted when the given overloaded variant of ::func
451    is used but not when GNULIB_NAMESPACE::func is used.  */
452 #if defined __cplusplus && defined GNULIB_NAMESPACE
453 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
454    _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
455                         GNULIB_NAMESPACE)
456 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
457    _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
458 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
459    we enable the warning only when not optimizing.  */
460 # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
461 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
462     _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
463                          "The symbol ::" #func " refers to the system function. " \
464                          "Use " #namespace "::" #func " instead.")
465 # else
466 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
467      _GL_EXTERN_C int _gl_cxxalias_dummy
468 # endif
469 #else
470 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
471     _GL_EXTERN_C int _gl_cxxalias_dummy
472 #endif
473 
474 #endif /* _GL_CXXDEFS_H */
475 
476 /* The definition of _GL_ARG_NONNULL is copied here.  */
477 /* A C macro for declaring that specific arguments must not be NULL.
478    Copyright (C) 2009-2021 Free Software Foundation, Inc.
479 
480    This program is free software: you can redistribute it and/or modify it
481    under the terms of the GNU Lesser General Public License as published
482    by the Free Software Foundation; either version 2 of the License, or
483    (at your option) any later version.
484 
485    This program is distributed in the hope that it will be useful,
486    but WITHOUT ANY WARRANTY; without even the implied warranty of
487    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
488    Lesser General Public License for more details.
489 
490    You should have received a copy of the GNU Lesser General Public License
491    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
492 
493 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
494    that the values passed as arguments n, ..., m must be non-NULL pointers.
495    n = 1 stands for the first argument, n = 2 for the second argument etc.  */
496 #ifndef _GL_ARG_NONNULL
497 # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
498 #  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
499 # else
500 #  define _GL_ARG_NONNULL(params)
501 # endif
502 #endif
503 
504 /* The definition of _GL_WARN_ON_USE is copied here.  */
505 /* A C macro for emitting warnings if a function is used.
506    Copyright (C) 2010-2021 Free Software Foundation, Inc.
507 
508    This program is free software: you can redistribute it and/or modify it
509    under the terms of the GNU Lesser General Public License as published
510    by the Free Software Foundation; either version 2 of the License, or
511    (at your option) any later version.
512 
513    This program is distributed in the hope that it will be useful,
514    but WITHOUT ANY WARRANTY; without even the implied warranty of
515    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
516    Lesser General Public License for more details.
517 
518    You should have received a copy of the GNU Lesser General Public License
519    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
520 
521 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
522    for FUNCTION which will then trigger a compiler warning containing
523    the text of "literal string" anywhere that function is called, if
524    supported by the compiler.  If the compiler does not support this
525    feature, the macro expands to an unused extern declaration.
526 
527    _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
528    attribute used in _GL_WARN_ON_USE.  If the compiler does not support
529    this feature, it expands to empty.
530 
531    These macros are useful for marking a function as a potential
532    portability trap, with the intent that "literal string" include
533    instructions on the replacement function that should be used
534    instead.
535    _GL_WARN_ON_USE is for functions with 'extern' linkage.
536    _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
537    linkage.
538 
539    However, one of the reasons that a function is a portability trap is
540    if it has the wrong signature.  Declaring FUNCTION with a different
541    signature in C is a compilation error, so this macro must use the
542    same type as any existing declaration so that programs that avoid
543    the problematic FUNCTION do not fail to compile merely because they
544    included a header that poisoned the function.  But this implies that
545    _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
546    have a declaration.  Use of this macro implies that there must not
547    be any other macro hiding the declaration of FUNCTION; but
548    undefining FUNCTION first is part of the poisoning process anyway
549    (although for symbols that are provided only via a macro, the result
550    is a compilation error rather than a warning containing
551    "literal string").  Also note that in C++, it is only safe to use if
552    FUNCTION has no overloads.
553 
554    For an example, it is possible to poison 'getline' by:
555    - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
556      [getline]) in configure.ac, which potentially defines
557      HAVE_RAW_DECL_GETLINE
558    - adding this code to a header that wraps the system <stdio.h>:
559      #undef getline
560      #if HAVE_RAW_DECL_GETLINE
561      _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
562        "not universally present; use the gnulib module getline");
563      #endif
564 
565    It is not possible to directly poison global variables.  But it is
566    possible to write a wrapper accessor function, and poison that
567    (less common usage, like &environ, will cause a compilation error
568    rather than issue the nice warning, but the end result of informing
569    the developer about their portability problem is still achieved):
570      #if HAVE_RAW_DECL_ENVIRON
571      static char ***
572      rpl_environ (void) { return &environ; }
573      _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
574      # undef environ
575      # define environ (*rpl_environ ())
576      #endif
577    or better (avoiding contradictory use of 'static' and 'extern'):
578      #if HAVE_RAW_DECL_ENVIRON
579      static char ***
580      _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
581      rpl_environ (void) { return &environ; }
582      # undef environ
583      # define environ (*rpl_environ ())
584      #endif
585    */
586 #ifndef _GL_WARN_ON_USE
587 
588 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
589 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
590 #  define _GL_WARN_ON_USE(function, message) \
591 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
592 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
593   __attribute__ ((__warning__ (message)))
594 # elif __clang_major__ >= 4
595 /* Another compiler attribute is available in clang.  */
596 #  define _GL_WARN_ON_USE(function, message) \
597 extern __typeof__ (function) function \
598   __attribute__ ((__diagnose_if__ (1, message, "warning")))
599 #  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
600   __attribute__ ((__diagnose_if__ (1, message, "warning")))
601 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
602 /* Verify the existence of the function.  */
603 #  define _GL_WARN_ON_USE(function, message) \
604 extern __typeof__ (function) function
605 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
606 # else /* Unsupported.  */
607 #  define _GL_WARN_ON_USE(function, message) \
608 _GL_WARN_EXTERN_C int _gl_warn_on_use
609 #  define _GL_WARN_ON_USE_ATTRIBUTE(message)
610 # endif
611 #endif
612 
613 /* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
614    is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
615    function is declared with the given prototype, consisting of return type,
616    parameters, and attributes.
617    This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
618    not work in this case.  */
619 #ifndef _GL_WARN_ON_USE_CXX
620 # if !defined __cplusplus
621 #  define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
622      _GL_WARN_ON_USE (function, msg)
623 # else
624 #  if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
625 /* A compiler attribute is available in gcc versions 4.3.0 and later.  */
626 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
627 extern rettype_gcc function parameters_and_attributes \
628   __attribute__ ((__warning__ (msg)))
629 #  elif __clang_major__ >= 4
630 /* Another compiler attribute is available in clang.  */
631 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
632 extern rettype_clang function parameters_and_attributes \
633   __attribute__ ((__diagnose_if__ (1, msg, "warning")))
634 #  elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
635 /* Verify the existence of the function.  */
636 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
637 extern rettype_gcc function parameters_and_attributes
638 #  else /* Unsupported.  */
639 #   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
640 _GL_WARN_EXTERN_C int _gl_warn_on_use
641 #  endif
642 # endif
643 #endif
644 
645 /* _GL_WARN_EXTERN_C declaration;
646    performs the declaration with C linkage.  */
647 #ifndef _GL_WARN_EXTERN_C
648 # if defined __cplusplus
649 #  define _GL_WARN_EXTERN_C extern "C"
650 # else
651 #  define _GL_WARN_EXTERN_C extern
652 # endif
653 #endif
654 
655 
656 /* Get getopt(), optarg, optind, opterr, optopt.  */
657 #if 0 && 0 && !defined _GL_SYSTEM_GETOPT
658 # include <getopt-cdefs.h>
659 # include <getopt-pfx-core.h>
660 #endif
661 
662 #ifndef _GL_INLINE_HEADER_BEGIN
663  #error "Please include config.h first."
664 #endif
665 _GL_INLINE_HEADER_BEGIN
666 #ifndef _GL_UNISTD_INLINE
667 # define _GL_UNISTD_INLINE _GL_INLINE
668 #endif
669 
670 /* Hide some function declarations from <winsock2.h>.  */
671 
672 #if 0 && 0
673 # if !defined _GL_SYS_SOCKET_H
674 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
675 #   undef socket
676 #   define socket              socket_used_without_including_sys_socket_h
677 #   undef connect
678 #   define connect             connect_used_without_including_sys_socket_h
679 #   undef accept
680 #   define accept              accept_used_without_including_sys_socket_h
681 #   undef bind
682 #   define bind                bind_used_without_including_sys_socket_h
683 #   undef getpeername
684 #   define getpeername         getpeername_used_without_including_sys_socket_h
685 #   undef getsockname
686 #   define getsockname         getsockname_used_without_including_sys_socket_h
687 #   undef getsockopt
688 #   define getsockopt          getsockopt_used_without_including_sys_socket_h
689 #   undef listen
690 #   define listen              listen_used_without_including_sys_socket_h
691 #   undef recv
692 #   define recv                recv_used_without_including_sys_socket_h
693 #   undef send
694 #   define send                send_used_without_including_sys_socket_h
695 #   undef recvfrom
696 #   define recvfrom            recvfrom_used_without_including_sys_socket_h
697 #   undef sendto
698 #   define sendto              sendto_used_without_including_sys_socket_h
699 #   undef setsockopt
700 #   define setsockopt          setsockopt_used_without_including_sys_socket_h
701 #   undef shutdown
702 #   define shutdown            shutdown_used_without_including_sys_socket_h
703 #  else
704     _GL_WARN_ON_USE (socket,
705                      "socket() used without including <sys/socket.h>");
706     _GL_WARN_ON_USE (connect,
707                      "connect() used without including <sys/socket.h>");
708     _GL_WARN_ON_USE (accept,
709                      "accept() used without including <sys/socket.h>");
710     _GL_WARN_ON_USE (bind,
711                      "bind() used without including <sys/socket.h>");
712     _GL_WARN_ON_USE (getpeername,
713                      "getpeername() used without including <sys/socket.h>");
714     _GL_WARN_ON_USE (getsockname,
715                      "getsockname() used without including <sys/socket.h>");
716     _GL_WARN_ON_USE (getsockopt,
717                      "getsockopt() used without including <sys/socket.h>");
718     _GL_WARN_ON_USE (listen,
719                      "listen() used without including <sys/socket.h>");
720     _GL_WARN_ON_USE (recv,
721                      "recv() used without including <sys/socket.h>");
722     _GL_WARN_ON_USE (send,
723                      "send() used without including <sys/socket.h>");
724     _GL_WARN_ON_USE (recvfrom,
725                      "recvfrom() used without including <sys/socket.h>");
726     _GL_WARN_ON_USE (sendto,
727                      "sendto() used without including <sys/socket.h>");
728     _GL_WARN_ON_USE (setsockopt,
729                      "setsockopt() used without including <sys/socket.h>");
730     _GL_WARN_ON_USE (shutdown,
731                      "shutdown() used without including <sys/socket.h>");
732 #  endif
733 # endif
734 # if !defined _GL_SYS_SELECT_H
735 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
736 #   undef select
737 #   define select              select_used_without_including_sys_select_h
738 #  else
739     _GL_WARN_ON_USE (select,
740                      "select() used without including <sys/select.h>");
741 #  endif
742 # endif
743 #endif
744 
745 
746 /* OS/2 EMX lacks these macros.  */
747 #ifndef STDIN_FILENO
748 # define STDIN_FILENO 0
749 #endif
750 #ifndef STDOUT_FILENO
751 # define STDOUT_FILENO 1
752 #endif
753 #ifndef STDERR_FILENO
754 # define STDERR_FILENO 2
755 #endif
756 
757 /* Ensure *_OK macros exist.  */
758 #ifndef F_OK
759 # define F_OK 0
760 # define X_OK 1
761 # define W_OK 2
762 # define R_OK 4
763 #endif
764 
765 
766 /* Declare overridden functions.  */
767 
768 
769 #if 0
770 # if 0
771 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
772 #   undef access
773 #   define access rpl_access
774 #  endif
775 _GL_FUNCDECL_RPL (access, int, (const char *file, int mode)
776                                _GL_ARG_NONNULL ((1)));
777 _GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
778 # elif defined _WIN32 && !defined __CYGWIN__
779 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
780 #   undef access
781 #   define access _access
782 #  endif
783 _GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
784 # else
785 _GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
786 # endif
787 _GL_CXXALIASWARN (access);
788 #elif defined GNULIB_POSIXCHECK
789 # undef access
790 # if HAVE_RAW_DECL_ACCESS
791 /* The access() function is a security risk.  */
792 _GL_WARN_ON_USE (access, "access does not always support X_OK - "
793                  "use gnulib module access for portability; "
794                  "also, this function is a security risk - "
795                  "use the gnulib module faccessat instead");
796 # endif
797 #elif 1
798 /* On native Windows, map 'access' to '_access', so that -loldnames is not
799    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
800    platforms by defining GNULIB_NAMESPACE::access always.  */
801 # if defined _WIN32 && !defined __CYGWIN__
802 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
803 #   undef access
804 #   define access _access
805 #  endif
806 _GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
807 # else
808 _GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
809 # endif
810 _GL_CXXALIASWARN (access);
811 #endif
812 
813 
814 #if 0
815 # if defined _WIN32 && !defined __CYGWIN__
816 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
817 #   undef chdir
818 #   define chdir _chdir
819 #  endif
820 _GL_CXXALIAS_MDA (chdir, int, (const char *file));
821 # else
822 _GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
823 # endif
824 _GL_CXXALIASWARN (chdir);
825 #elif defined GNULIB_POSIXCHECK
826 # undef chdir
827 # if HAVE_RAW_DECL_CHDIR
828 _GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
829                  "use gnulib module chdir for portability");
830 # endif
831 #elif 1
832 /* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not
833    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
834    platforms by defining GNULIB_NAMESPACE::chdir always.  */
835 # if defined _WIN32 && !defined __CYGWIN__
836 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
837 #   undef chdir
838 #   define chdir _chdir
839 #  endif
840 _GL_CXXALIAS_MDA (chdir, int, (const char *file));
841 # else
842 _GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
843 # endif
844 _GL_CXXALIASWARN (chdir);
845 #endif
846 
847 
848 #if 0
849 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
850    to GID (if GID is not -1).  Follow symbolic links.
851    Return 0 if successful, otherwise -1 and errno set.
852    See the POSIX:2008 specification
853    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html.  */
854 # if 0
855 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
856 #   undef chown
857 #   define chown rpl_chown
858 #  endif
859 _GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
860                               _GL_ARG_NONNULL ((1)));
861 _GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
862 # else
863 #  if !1
864 _GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
865                               _GL_ARG_NONNULL ((1)));
866 #  endif
867 _GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
868 # endif
869 _GL_CXXALIASWARN (chown);
870 #elif defined GNULIB_POSIXCHECK
871 # undef chown
872 # if HAVE_RAW_DECL_CHOWN
873 _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
874                  "doesn't treat a uid or gid of -1 on some systems - "
875                  "use gnulib module chown for portability");
876 # endif
877 #endif
878 
879 
880 #if 0
881 # if 0
882 /* Automatically included by modules that need a replacement for close.  */
883 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
884 #   undef close
885 #   define close rpl_close
886 #  endif
887 _GL_FUNCDECL_RPL (close, int, (int fd));
888 _GL_CXXALIAS_RPL (close, int, (int fd));
889 # elif defined _WIN32 && !defined __CYGWIN__
890 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
891 #   undef close
892 #   define close _close
893 #  endif
894 _GL_CXXALIAS_MDA (close, int, (int fd));
895 # else
896 _GL_CXXALIAS_SYS (close, int, (int fd));
897 # endif
898 _GL_CXXALIASWARN (close);
899 #elif 0
900 # undef close
901 # define close close_used_without_requesting_gnulib_module_close
902 #elif defined GNULIB_POSIXCHECK
903 # undef close
904 /* Assume close is always declared.  */
905 _GL_WARN_ON_USE (close, "close does not portably work on sockets - "
906                  "use gnulib module close for portability");
907 #elif 1
908 /* On native Windows, map 'close' to '_close', so that -loldnames is not
909    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
910    platforms by defining GNULIB_NAMESPACE::close always.  */
911 # if defined _WIN32 && !defined __CYGWIN__
912 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
913 #   undef close
914 #   define close _close
915 #  endif
916 _GL_CXXALIAS_MDA (close, int, (int fd));
917 # else
918 _GL_CXXALIAS_SYS (close, int, (int fd));
919 # endif
920 _GL_CXXALIASWARN (close);
921 #endif
922 
923 
924 #if 0
925 # if !1
926 _GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
927                                              int ofd, off_t *opos,
928                                              size_t len, unsigned flags));
929 _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
930                                              int ofd, off_t *opos,
931                                              size_t len, unsigned flags));
932 # endif
933 _GL_CXXALIASWARN (copy_file_range);
934 #elif defined GNULIB_POSIXCHECK
935 # if HAVE_RAW_DECL_COPY_FILE_RANGE
936 _GL_WARN_ON_USE (copy_file_range,
937                  "copy_file_range is unportable - "
938                  "use gnulib module copy_file_range for portability");
939 # endif
940 #endif
941 
942 
943 #if 0
944 # if 0
945 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
946 #   define dup rpl_dup
947 #  endif
948 _GL_FUNCDECL_RPL (dup, int, (int oldfd));
949 _GL_CXXALIAS_RPL (dup, int, (int oldfd));
950 # elif defined _WIN32 && !defined __CYGWIN__
951 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
952 #   undef dup
953 #   define dup _dup
954 #  endif
955 _GL_CXXALIAS_MDA (dup, int, (int oldfd));
956 # else
957 _GL_CXXALIAS_SYS (dup, int, (int oldfd));
958 # endif
959 _GL_CXXALIASWARN (dup);
960 #elif defined GNULIB_POSIXCHECK
961 # undef dup
962 # if HAVE_RAW_DECL_DUP
963 _GL_WARN_ON_USE (dup, "dup is unportable - "
964                  "use gnulib module dup for portability");
965 # endif
966 #elif 1
967 /* On native Windows, map 'dup' to '_dup', so that -loldnames is not
968    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
969    platforms by defining GNULIB_NAMESPACE::dup always.  */
970 # if defined _WIN32 && !defined __CYGWIN__
971 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
972 #   undef dup
973 #   define dup _dup
974 #  endif
975 _GL_CXXALIAS_MDA (dup, int, (int oldfd));
976 # else
977 _GL_CXXALIAS_SYS (dup, int, (int oldfd));
978 # endif
979 _GL_CXXALIASWARN (dup);
980 #endif
981 
982 
983 #if 0
984 /* Copy the file descriptor OLDFD into file descriptor NEWFD.  Do nothing if
985    NEWFD = OLDFD, otherwise close NEWFD first if it is open.
986    Return newfd if successful, otherwise -1 and errno set.
987    See the POSIX:2008 specification
988    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>.  */
989 # if 0
990 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
991 #   define dup2 rpl_dup2
992 #  endif
993 _GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
994 _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
995 # elif defined _WIN32 && !defined __CYGWIN__
996 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
997 #   undef dup2
998 #   define dup2 _dup2
999 #  endif
1000 _GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
1001 # else
1002 _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
1003 # endif
1004 _GL_CXXALIASWARN (dup2);
1005 #elif defined GNULIB_POSIXCHECK
1006 # undef dup2
1007 # if HAVE_RAW_DECL_DUP2
1008 _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
1009                  "use gnulib module dup2 for portability");
1010 # endif
1011 #elif 1
1012 /* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not
1013    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1014    platforms by defining GNULIB_NAMESPACE::dup2 always.  */
1015 # if defined _WIN32 && !defined __CYGWIN__
1016 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1017 #   undef dup2
1018 #   define dup2 _dup2
1019 #  endif
1020 _GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
1021 # else
1022 _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
1023 # endif
1024 _GL_CXXALIASWARN (dup2);
1025 #endif
1026 
1027 
1028 #if 0
1029 /* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
1030    specified flags.
1031    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
1032    and O_TEXT, O_BINARY (defined in "binary-io.h").
1033    Close NEWFD first if it is open.
1034    Return newfd if successful, otherwise -1 and errno set.
1035    See the Linux man page at
1036    <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>.  */
1037 # if 1
1038 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1039 #   define dup3 rpl_dup3
1040 #  endif
1041 _GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
1042 _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
1043 # else
1044 _GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
1045 _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
1046 # endif
1047 _GL_CXXALIASWARN (dup3);
1048 #elif defined GNULIB_POSIXCHECK
1049 # undef dup3
1050 # if HAVE_RAW_DECL_DUP3
1051 _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
1052                  "use gnulib module dup3 for portability");
1053 # endif
1054 #endif
1055 
1056 
1057 #if 0
1058 # if defined __CYGWIN__ && !defined __i386__
1059 /* The 'environ' variable is defined in a DLL. Therefore its declaration needs
1060    the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it.
1061    This leads to a link error on 64-bit Cygwin when the option
1062    -Wl,--disable-auto-import is in use.  */
1063 _GL_EXTERN_C __declspec(dllimport) char **environ;
1064 # endif
1065 # if !1
1066 /* Set of environment variables and values.  An array of strings of the form
1067    "VARIABLE=VALUE", terminated with a NULL.  */
1068 #  if defined __APPLE__ && defined __MACH__
1069 #   include <TargetConditionals.h>
1070 #   if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
1071 #    define _GL_USE_CRT_EXTERNS
1072 #   endif
1073 #  endif
1074 #  ifdef _GL_USE_CRT_EXTERNS
1075 #   include <crt_externs.h>
1076 #   define environ (*_NSGetEnviron ())
1077 #  else
1078 #   ifdef __cplusplus
1079 extern "C" {
1080 #   endif
1081 extern char **environ;
1082 #   ifdef __cplusplus
1083 }
1084 #   endif
1085 #  endif
1086 # endif
1087 #elif defined GNULIB_POSIXCHECK
1088 # if HAVE_RAW_DECL_ENVIRON
1089 _GL_UNISTD_INLINE char ***
1090 _GL_WARN_ON_USE_ATTRIBUTE ("environ is unportable - "
1091                            "use gnulib module environ for portability")
rpl_environ(void)1092 rpl_environ (void)
1093 {
1094   return &environ;
1095 }
1096 #  undef environ
1097 #  define environ (*rpl_environ ())
1098 # endif
1099 #endif
1100 
1101 
1102 #if 0
1103 /* Like access(), except that it uses the effective user id and group id of
1104    the current process.  */
1105 # if !1
1106 _GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
1107                                    _GL_ARG_NONNULL ((1)));
1108 # endif
1109 _GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
1110 _GL_CXXALIASWARN (euidaccess);
1111 # if defined GNULIB_POSIXCHECK
1112 /* Like access(), this function is a security risk.  */
1113 _GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
1114                  "use the gnulib module faccessat instead");
1115 # endif
1116 #elif defined GNULIB_POSIXCHECK
1117 # undef euidaccess
1118 # if HAVE_RAW_DECL_EUIDACCESS
1119 _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
1120                  "use gnulib module euidaccess for portability");
1121 # endif
1122 #endif
1123 
1124 
1125 #if 0
1126 # if 0
1127 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1128 #   undef execl
1129 #   define execl rpl_execl
1130 #  endif
1131 _GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...)
1132                               _GL_ARG_NONNULL ((1)));
1133 _GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...));
1134 # else
1135 _GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
1136 # endif
1137 _GL_CXXALIASWARN (execl);
1138 #elif defined GNULIB_POSIXCHECK
1139 # undef execl
1140 # if HAVE_RAW_DECL_EXECL
1141 _GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - "
1142                  "use gnulib module execl for portability");
1143 # endif
1144 #elif 1
1145 /* On native Windows, map 'execl' to '_execl', so that -loldnames is not
1146    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1147    platforms by defining GNULIB_NAMESPACE::execl always.  */
1148 # if defined _WIN32 && !defined __CYGWIN__
1149 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1150 #   undef execl
1151 #   define execl _execl
1152 #  endif
1153 _GL_CXXALIAS_MDA (execl, intptr_t, (const char *program, const char *arg, ...));
1154 # else
1155 _GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
1156 # endif
1157 _GL_CXXALIASWARN (execl);
1158 #endif
1159 
1160 #if 0
1161 # if 0
1162 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1163 #   undef execle
1164 #   define execle rpl_execle
1165 #  endif
1166 _GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...)
1167                                _GL_ARG_NONNULL ((1)));
1168 _GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...));
1169 # else
1170 _GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
1171 # endif
1172 _GL_CXXALIASWARN (execle);
1173 #elif defined GNULIB_POSIXCHECK
1174 # undef execle
1175 # if HAVE_RAW_DECL_EXECLE
1176 _GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - "
1177                  "use gnulib module execle for portability");
1178 # endif
1179 #elif 1
1180 /* On native Windows, map 'execle' to '_execle', so that -loldnames is not
1181    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1182    platforms by defining GNULIB_NAMESPACE::execle always.  */
1183 # if defined _WIN32 && !defined __CYGWIN__
1184 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1185 #   undef execle
1186 #   define execle _execle
1187 #  endif
1188 _GL_CXXALIAS_MDA (execle, intptr_t,
1189                   (const char *program, const char *arg, ...));
1190 # else
1191 _GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
1192 # endif
1193 _GL_CXXALIASWARN (execle);
1194 #endif
1195 
1196 #if 0
1197 # if 0
1198 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1199 #   undef execlp
1200 #   define execlp rpl_execlp
1201 #  endif
1202 _GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...)
1203                                _GL_ARG_NONNULL ((1)));
1204 _GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...));
1205 # else
1206 _GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
1207 # endif
1208 _GL_CXXALIASWARN (execlp);
1209 #elif defined GNULIB_POSIXCHECK
1210 # undef execlp
1211 # if HAVE_RAW_DECL_EXECLP
1212 _GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - "
1213                  "use gnulib module execlp for portability");
1214 # endif
1215 #elif 1
1216 /* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not
1217    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1218    platforms by defining GNULIB_NAMESPACE::execlp always.  */
1219 # if defined _WIN32 && !defined __CYGWIN__
1220 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1221 #   undef execlp
1222 #   define execlp _execlp
1223 #  endif
1224 _GL_CXXALIAS_MDA (execlp, intptr_t,
1225                   (const char *program, const char *arg, ...));
1226 # else
1227 _GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
1228 # endif
1229 _GL_CXXALIASWARN (execlp);
1230 #endif
1231 
1232 
1233 #if 0
1234 # if 0
1235 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1236 #   undef execv
1237 #   define execv rpl_execv
1238 #  endif
1239 _GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv)
1240                               _GL_ARG_NONNULL ((1, 2)));
1241 _GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv));
1242 # else
1243 _GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
1244 # endif
1245 _GL_CXXALIASWARN (execv);
1246 #elif defined GNULIB_POSIXCHECK
1247 # undef execv
1248 # if HAVE_RAW_DECL_EXECV
1249 _GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - "
1250                  "use gnulib module execv for portability");
1251 # endif
1252 #elif 1
1253 /* On native Windows, map 'execv' to '_execv', so that -loldnames is not
1254    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1255    platforms by defining GNULIB_NAMESPACE::execv always.  */
1256 # if defined _WIN32 && !defined __CYGWIN__
1257 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1258 #   undef execv
1259 #   define execv _execv
1260 #  endif
1261 _GL_CXXALIAS_MDA_CAST (execv, intptr_t,
1262                        (const char *program, char * const *argv));
1263 # else
1264 _GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
1265 # endif
1266 _GL_CXXALIASWARN (execv);
1267 #endif
1268 
1269 #if 0
1270 # if 0
1271 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1272 #   undef execve
1273 #   define execve rpl_execve
1274 #  endif
1275 _GL_FUNCDECL_RPL (execve, int,
1276                   (const char *program, char * const *argv, char * const *env)
1277                   _GL_ARG_NONNULL ((1, 2)));
1278 _GL_CXXALIAS_RPL (execve, int,
1279                   (const char *program, char * const *argv, char * const *env));
1280 # else
1281 _GL_CXXALIAS_SYS (execve, int,
1282                   (const char *program, char * const *argv, char * const *env));
1283 # endif
1284 _GL_CXXALIASWARN (execve);
1285 #elif defined GNULIB_POSIXCHECK
1286 # undef execve
1287 # if HAVE_RAW_DECL_EXECVE
1288 _GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - "
1289                  "use gnulib module execve for portability");
1290 # endif
1291 #elif 1
1292 /* On native Windows, map 'execve' to '_execve', so that -loldnames is not
1293    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1294    platforms by defining GNULIB_NAMESPACE::execve always.  */
1295 # if defined _WIN32 && !defined __CYGWIN__
1296 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1297 #   undef execve
1298 #   define execve _execve
1299 #  endif
1300 _GL_CXXALIAS_MDA_CAST (execve, intptr_t,
1301                        (const char *program, char * const *argv,
1302                         char * const *env));
1303 # else
1304 _GL_CXXALIAS_SYS (execve, int,
1305                   (const char *program, char * const *argv, char * const *env));
1306 # endif
1307 _GL_CXXALIASWARN (execve);
1308 #endif
1309 
1310 #if 0
1311 # if 0
1312 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1313 #   undef execvp
1314 #   define execvp rpl_execvp
1315 #  endif
1316 _GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv)
1317                                _GL_ARG_NONNULL ((1, 2)));
1318 _GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv));
1319 # else
1320 _GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
1321 # endif
1322 _GL_CXXALIASWARN (execvp);
1323 #elif defined GNULIB_POSIXCHECK
1324 # undef execvp
1325 # if HAVE_RAW_DECL_EXECVP
1326 _GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - "
1327                  "use gnulib module execvp for portability");
1328 # endif
1329 #elif 1
1330 /* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not
1331    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1332    platforms by defining GNULIB_NAMESPACE::execvp always.  */
1333 # if defined _WIN32 && !defined __CYGWIN__
1334 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1335 #   undef execvp
1336 #   define execvp _execvp
1337 #  endif
1338 _GL_CXXALIAS_MDA_CAST (execvp, intptr_t,
1339                        (const char *program, char * const *argv));
1340 # else
1341 _GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
1342 # endif
1343 _GL_CXXALIASWARN (execvp);
1344 #endif
1345 
1346 #if 0
1347 # if 0
1348 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1349 #   undef execvpe
1350 #   define execvpe rpl_execvpe
1351 #  endif
1352 _GL_FUNCDECL_RPL (execvpe, int,
1353                   (const char *program, char * const *argv, char * const *env)
1354                   _GL_ARG_NONNULL ((1, 2)));
1355 _GL_CXXALIAS_RPL (execvpe, int,
1356                   (const char *program, char * const *argv, char * const *env));
1357 # else
1358 #  if !1
1359 _GL_FUNCDECL_SYS (execvpe, int,
1360                   (const char *program, char * const *argv, char * const *env)
1361                   _GL_ARG_NONNULL ((1, 2)));
1362 #  endif
1363 _GL_CXXALIAS_SYS (execvpe, int,
1364                   (const char *program, char * const *argv, char * const *env));
1365 # endif
1366 _GL_CXXALIASWARN (execvpe);
1367 #elif defined GNULIB_POSIXCHECK
1368 # undef execvpe
1369 # if HAVE_RAW_DECL_EXECVPE
1370 _GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - "
1371                  "use gnulib module execvpe for portability");
1372 # endif
1373 #elif 1
1374 /* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not
1375    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1376    platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have
1377    it.  */
1378 # if defined _WIN32 && !defined __CYGWIN__
1379 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1380 #   undef execvpe
1381 #   define execvpe _execvpe
1382 #  endif
1383 _GL_CXXALIAS_MDA_CAST (execvpe, intptr_t,
1384                        (const char *program, char * const *argv,
1385                         char * const *env));
1386 # elif 1
1387 #  if !1
1388 _GL_FUNCDECL_SYS (execvpe, int,
1389                   (const char *program, char * const *argv, char * const *env)
1390                   _GL_ARG_NONNULL ((1, 2)));
1391 #  endif
1392 _GL_CXXALIAS_SYS (execvpe, int,
1393                   (const char *program, char * const *argv, char * const *env));
1394 # endif
1395 # if (defined _WIN32 && !defined __CYGWIN__) || 1
1396 _GL_CXXALIASWARN (execvpe);
1397 # endif
1398 #endif
1399 
1400 
1401 #if 0
1402 # if 0
1403 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1404 #   undef faccessat
1405 #   define faccessat rpl_faccessat
1406 #  endif
1407 _GL_FUNCDECL_RPL (faccessat, int,
1408                   (int fd, char const *name, int mode, int flag)
1409                   _GL_ARG_NONNULL ((2)));
1410 _GL_CXXALIAS_RPL (faccessat, int,
1411                   (int fd, char const *name, int mode, int flag));
1412 # else
1413 #  if !1
1414 _GL_FUNCDECL_SYS (faccessat, int,
1415                   (int fd, char const *file, int mode, int flag)
1416                   _GL_ARG_NONNULL ((2)));
1417 #  endif
1418 _GL_CXXALIAS_SYS (faccessat, int,
1419                   (int fd, char const *file, int mode, int flag));
1420 # endif
1421 _GL_CXXALIASWARN (faccessat);
1422 #elif defined GNULIB_POSIXCHECK
1423 # undef faccessat
1424 # if HAVE_RAW_DECL_FACCESSAT
1425 _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
1426                  "use gnulib module faccessat for portability");
1427 # endif
1428 #endif
1429 
1430 
1431 #if 0
1432 /* Change the process' current working directory to the directory on which
1433    the given file descriptor is open.
1434    Return 0 if successful, otherwise -1 and errno set.
1435    See the POSIX:2008 specification
1436    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>.  */
1437 # if ! 1
1438 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
1439 
1440 /* Gnulib internal hooks needed to maintain the fchdir metadata.  */
1441 _GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
1442      _GL_ARG_NONNULL ((2));
1443 _GL_EXTERN_C void _gl_unregister_fd (int fd);
1444 _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
1445 _GL_EXTERN_C const char *_gl_directory_name (int fd);
1446 
1447 # else
1448 #  if !1
1449 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
1450 #  endif
1451 # endif
1452 _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
1453 _GL_CXXALIASWARN (fchdir);
1454 #elif defined GNULIB_POSIXCHECK
1455 # undef fchdir
1456 # if HAVE_RAW_DECL_FCHDIR
1457 _GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
1458                  "use gnulib module fchdir for portability");
1459 # endif
1460 #endif
1461 
1462 
1463 #if 0
1464 # if 0
1465 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1466 #   undef fchownat
1467 #   define fchownat rpl_fchownat
1468 #  endif
1469 _GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
1470                                   uid_t owner, gid_t group, int flag)
1471                                  _GL_ARG_NONNULL ((2)));
1472 _GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
1473                                   uid_t owner, gid_t group, int flag));
1474 # else
1475 #  if !1
1476 _GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
1477                                   uid_t owner, gid_t group, int flag)
1478                                  _GL_ARG_NONNULL ((2)));
1479 #  endif
1480 _GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
1481                                   uid_t owner, gid_t group, int flag));
1482 # endif
1483 _GL_CXXALIASWARN (fchownat);
1484 #elif defined GNULIB_POSIXCHECK
1485 # undef fchownat
1486 # if HAVE_RAW_DECL_FCHOWNAT
1487 _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
1488                  "use gnulib module fchownat for portability");
1489 # endif
1490 #endif
1491 
1492 
1493 #if 0
1494 /* Synchronize changes to a file.
1495    Return 0 if successful, otherwise -1 and errno set.
1496    See POSIX:2008 specification
1497    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>.  */
1498 # if !1 || !1
1499 _GL_FUNCDECL_SYS (fdatasync, int, (int fd));
1500 # endif
1501 _GL_CXXALIAS_SYS (fdatasync, int, (int fd));
1502 _GL_CXXALIASWARN (fdatasync);
1503 #elif defined GNULIB_POSIXCHECK
1504 # undef fdatasync
1505 # if HAVE_RAW_DECL_FDATASYNC
1506 _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
1507                  "use gnulib module fdatasync for portability");
1508 # endif
1509 #endif
1510 
1511 
1512 #if 0
1513 /* Synchronize changes, including metadata, to a file.
1514    Return 0 if successful, otherwise -1 and errno set.
1515    See POSIX:2008 specification
1516    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>.  */
1517 # if !1
1518 _GL_FUNCDECL_SYS (fsync, int, (int fd));
1519 # endif
1520 _GL_CXXALIAS_SYS (fsync, int, (int fd));
1521 _GL_CXXALIASWARN (fsync);
1522 #elif defined GNULIB_POSIXCHECK
1523 # undef fsync
1524 # if HAVE_RAW_DECL_FSYNC
1525 _GL_WARN_ON_USE (fsync, "fsync is unportable - "
1526                  "use gnulib module fsync for portability");
1527 # endif
1528 #endif
1529 
1530 
1531 #if 0
1532 /* Change the size of the file to which FD is opened to become equal to LENGTH.
1533    Return 0 if successful, otherwise -1 and errno set.
1534    See the POSIX:2008 specification
1535    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>.  */
1536 # if 0
1537 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1538 #   undef ftruncate
1539 #   define ftruncate rpl_ftruncate
1540 #  endif
1541 _GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
1542 _GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
1543 # else
1544 #  if !1
1545 _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
1546 #  endif
1547 _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
1548 # endif
1549 _GL_CXXALIASWARN (ftruncate);
1550 #elif defined GNULIB_POSIXCHECK
1551 # undef ftruncate
1552 # if HAVE_RAW_DECL_FTRUNCATE
1553 _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
1554                  "use gnulib module ftruncate for portability");
1555 # endif
1556 #endif
1557 
1558 
1559 #if 0
1560 /* Get the name of the current working directory, and put it in SIZE bytes
1561    of BUF.
1562    Return BUF if successful, or NULL if the directory couldn't be determined
1563    or SIZE was too small.
1564    See the POSIX:2008 specification
1565    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
1566    Additionally, the gnulib module 'getcwd' guarantees the following GNU
1567    extension: If BUF is NULL, an array is allocated with 'malloc'; the array
1568    is SIZE bytes long, unless SIZE == 0, in which case it is as big as
1569    necessary.  */
1570 # if 0
1571 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1572 #   define getcwd rpl_getcwd
1573 #  endif
1574 _GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
1575 _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
1576 # elif defined _WIN32 && !defined __CYGWIN__
1577 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1578 #   undef getcwd
1579 #   define getcwd _getcwd
1580 #  endif
1581 _GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size));
1582 # else
1583 /* Need to cast, because on mingw, the second parameter is
1584                                                    int size.  */
1585 _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
1586 # endif
1587 _GL_CXXALIASWARN (getcwd);
1588 #elif defined GNULIB_POSIXCHECK
1589 # undef getcwd
1590 # if HAVE_RAW_DECL_GETCWD
1591 _GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
1592                  "use gnulib module getcwd for portability");
1593 # endif
1594 #elif 1
1595 /* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not
1596    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1597    platforms by defining GNULIB_NAMESPACE::getcwd always.  */
1598 # if defined _WIN32 && !defined __CYGWIN__
1599 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1600 #   undef getcwd
1601 #   define getcwd _getcwd
1602 #  endif
1603 /* Need to cast, because on mingw, the second parameter is either
1604    'int size' or 'size_t size'.  */
1605 _GL_CXXALIAS_MDA_CAST (getcwd, char *, (char *buf, size_t size));
1606 # else
1607 _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
1608 # endif
1609 _GL_CXXALIASWARN (getcwd);
1610 #endif
1611 
1612 
1613 #if 0
1614 /* Return the NIS domain name of the machine.
1615    WARNING! The NIS domain name is unrelated to the fully qualified host name
1616             of the machine.  It is also unrelated to email addresses.
1617    WARNING! The NIS domain name is usually the empty string or "(none)" when
1618             not using NIS.
1619 
1620    Put up to LEN bytes of the NIS domain name into NAME.
1621    Null terminate it if the name is shorter than LEN.
1622    If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
1623    Return 0 if successful, otherwise set errno and return -1.  */
1624 # if 0
1625 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1626 #   undef getdomainname
1627 #   define getdomainname rpl_getdomainname
1628 #  endif
1629 _GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
1630                                       _GL_ARG_NONNULL ((1)));
1631 _GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
1632 # else
1633 #  if !1
1634 _GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
1635                                       _GL_ARG_NONNULL ((1)));
1636 #  endif
1637 _GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
1638 # endif
1639 _GL_CXXALIASWARN (getdomainname);
1640 #elif defined GNULIB_POSIXCHECK
1641 # undef getdomainname
1642 # if HAVE_RAW_DECL_GETDOMAINNAME
1643 _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
1644                  "use gnulib module getdomainname for portability");
1645 # endif
1646 #endif
1647 
1648 
1649 #if 0
1650 /* Return the maximum number of file descriptors in the current process.
1651    In POSIX, this is same as sysconf (_SC_OPEN_MAX).  */
1652 # if 0
1653 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1654 #   undef getdtablesize
1655 #   define getdtablesize rpl_getdtablesize
1656 #  endif
1657 _GL_FUNCDECL_RPL (getdtablesize, int, (void));
1658 _GL_CXXALIAS_RPL (getdtablesize, int, (void));
1659 # else
1660 #  if !1
1661 _GL_FUNCDECL_SYS (getdtablesize, int, (void));
1662 #  endif
1663 /* Need to cast, because on AIX, the parameter list is
1664                                            (...).  */
1665 _GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void));
1666 # endif
1667 _GL_CXXALIASWARN (getdtablesize);
1668 #elif defined GNULIB_POSIXCHECK
1669 # undef getdtablesize
1670 # if HAVE_RAW_DECL_GETDTABLESIZE
1671 _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
1672                  "use gnulib module getdtablesize for portability");
1673 # endif
1674 #endif
1675 
1676 
1677 #if 0
1678 /* Fill a buffer with random bytes.  */
1679 # if !1
1680 _GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length));
1681 # endif
1682 _GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length));
1683 _GL_CXXALIASWARN (getentropy);
1684 #elif defined GNULIB_POSIXCHECK
1685 # undef getentropy
1686 # if HAVE_RAW_DECL_GETENTROPY
1687 _GL_WARN_ON_USE (getentropy, "getentropy is unportable - "
1688                  "use gnulib module getentropy for portability");
1689 # endif
1690 #endif
1691 
1692 
1693 #if 0
1694 /* Return the supplemental groups that the current process belongs to.
1695    It is unspecified whether the effective group id is in the list.
1696    If N is 0, return the group count; otherwise, N describes how many
1697    entries are available in GROUPS.  Return -1 and set errno if N is
1698    not 0 and not large enough.  Fails with ENOSYS on some systems.  */
1699 # if 0
1700 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1701 #   undef getgroups
1702 #   define getgroups rpl_getgroups
1703 #  endif
1704 _GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
1705 _GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
1706 # else
1707 #  if !1
1708 _GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
1709 #  endif
1710 _GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
1711 # endif
1712 _GL_CXXALIASWARN (getgroups);
1713 #elif defined GNULIB_POSIXCHECK
1714 # undef getgroups
1715 # if HAVE_RAW_DECL_GETGROUPS
1716 _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
1717                  "use gnulib module getgroups for portability");
1718 # endif
1719 #endif
1720 
1721 
1722 #if 0
1723 /* Return the standard host name of the machine.
1724    WARNING! The host name may or may not be fully qualified.
1725 
1726    Put up to LEN bytes of the host name into NAME.
1727    Null terminate it if the name is shorter than LEN.
1728    If the host name is longer than LEN, set errno = EINVAL and return -1.
1729    Return 0 if successful, otherwise set errno and return -1.  */
1730 # if 0
1731 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1732 #   undef gethostname
1733 #   define gethostname rpl_gethostname
1734 #  endif
1735 _GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
1736                                     _GL_ARG_NONNULL ((1)));
1737 _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
1738 # else
1739 #  if !1
1740 _GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
1741                                     _GL_ARG_NONNULL ((1)));
1742 #  endif
1743 /* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
1744    parameter is
1745                                                       int len.  */
1746 _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
1747 # endif
1748 _GL_CXXALIASWARN (gethostname);
1749 #elif 0
1750 # undef gethostname
1751 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
1752 #elif defined GNULIB_POSIXCHECK
1753 # undef gethostname
1754 # if HAVE_RAW_DECL_GETHOSTNAME
1755 _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
1756                  "use gnulib module gethostname for portability");
1757 # endif
1758 #endif
1759 
1760 
1761 #if 0
1762 /* Returns the user's login name, or NULL if it cannot be found.  Upon error,
1763    returns NULL with errno set.
1764 
1765    See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
1766 
1767    Most programs don't need to use this function, because the information is
1768    available through environment variables:
1769      ${LOGNAME-$USER}        on Unix platforms,
1770      $USERNAME               on native Windows platforms.
1771  */
1772 # if !1
1773 _GL_FUNCDECL_SYS (getlogin, char *, (void));
1774 # endif
1775 _GL_CXXALIAS_SYS (getlogin, char *, (void));
1776 _GL_CXXALIASWARN (getlogin);
1777 #elif defined GNULIB_POSIXCHECK
1778 # undef getlogin
1779 # if HAVE_RAW_DECL_GETLOGIN
1780 _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
1781                  "use gnulib module getlogin for portability");
1782 # endif
1783 #endif
1784 
1785 
1786 #if 0
1787 /* Copies the user's login name to NAME.
1788    The array pointed to by NAME has room for SIZE bytes.
1789 
1790    Returns 0 if successful.  Upon error, an error number is returned, or -1 in
1791    the case that the login name cannot be found but no specific error is
1792    provided (this case is hopefully rare but is left open by the POSIX spec).
1793 
1794    See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
1795 
1796    Most programs don't need to use this function, because the information is
1797    available through environment variables:
1798      ${LOGNAME-$USER}        on Unix platforms,
1799      $USERNAME               on native Windows platforms.
1800  */
1801 # if 0
1802 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1803 #   define getlogin_r rpl_getlogin_r
1804 #  endif
1805 _GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
1806                                    _GL_ARG_NONNULL ((1)));
1807 _GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
1808 # else
1809 #  if !1
1810 _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
1811                                    _GL_ARG_NONNULL ((1)));
1812 #  endif
1813 /* Need to cast, because on Solaris 10 systems, the second argument is
1814                                                      int size.  */
1815 _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
1816 # endif
1817 _GL_CXXALIASWARN (getlogin_r);
1818 #elif defined GNULIB_POSIXCHECK
1819 # undef getlogin_r
1820 # if HAVE_RAW_DECL_GETLOGIN_R
1821 _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
1822                  "use gnulib module getlogin_r for portability");
1823 # endif
1824 #endif
1825 
1826 
1827 #if 0
1828 # if 0
1829 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1830 #   define getpagesize rpl_getpagesize
1831 #  endif
1832 _GL_FUNCDECL_RPL (getpagesize, int, (void));
1833 _GL_CXXALIAS_RPL (getpagesize, int, (void));
1834 # else
1835 /* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if
1836    the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used.  */
1837 #  if defined __hpux
1838 _GL_FUNCDECL_SYS (getpagesize, int, (void));
1839 #  endif
1840 #  if !1
1841 #   if !defined getpagesize
1842 /* This is for POSIX systems.  */
1843 #    if !defined _gl_getpagesize && defined _SC_PAGESIZE
1844 #     if ! (defined __VMS && __VMS_VER < 70000000)
1845 #      define _gl_getpagesize() sysconf (_SC_PAGESIZE)
1846 #     endif
1847 #    endif
1848 /* This is for older VMS.  */
1849 #    if !defined _gl_getpagesize && defined __VMS
1850 #     ifdef __ALPHA
1851 #      define _gl_getpagesize() 8192
1852 #     else
1853 #      define _gl_getpagesize() 512
1854 #     endif
1855 #    endif
1856 /* This is for BeOS.  */
1857 #    if !defined _gl_getpagesize && 0
1858 #     include <OS.h>
1859 #     if defined B_PAGE_SIZE
1860 #      define _gl_getpagesize() B_PAGE_SIZE
1861 #     endif
1862 #    endif
1863 /* This is for AmigaOS4.0.  */
1864 #    if !defined _gl_getpagesize && defined __amigaos4__
1865 #     define _gl_getpagesize() 2048
1866 #    endif
1867 /* This is for older Unix systems.  */
1868 #    if !defined _gl_getpagesize && 0
1869 #     include <sys/param.h>
1870 #     ifdef EXEC_PAGESIZE
1871 #      define _gl_getpagesize() EXEC_PAGESIZE
1872 #     else
1873 #      ifdef NBPG
1874 #       ifndef CLSIZE
1875 #        define CLSIZE 1
1876 #       endif
1877 #       define _gl_getpagesize() (NBPG * CLSIZE)
1878 #      else
1879 #       ifdef NBPC
1880 #        define _gl_getpagesize() NBPC
1881 #       endif
1882 #      endif
1883 #     endif
1884 #    endif
1885 #    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1886 #     define getpagesize() _gl_getpagesize ()
1887 #    else
1888 #     if !GNULIB_defined_getpagesize_function
1889 _GL_UNISTD_INLINE int
1890 getpagesize ()
1891 {
1892   return _gl_getpagesize ();
1893 }
1894 #      define GNULIB_defined_getpagesize_function 1
1895 #     endif
1896 #    endif
1897 #   endif
1898 #  endif
1899 /* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t.  */
1900 _GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
1901 # endif
1902 # if 1
1903 _GL_CXXALIASWARN (getpagesize);
1904 # endif
1905 #elif defined GNULIB_POSIXCHECK
1906 # undef getpagesize
1907 # if HAVE_RAW_DECL_GETPAGESIZE
1908 _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
1909                  "use gnulib module getpagesize for portability");
1910 # endif
1911 #endif
1912 
1913 
1914 #if 0
1915 /* Function getpass() from module 'getpass':
1916      Read a password from /dev/tty or stdin.
1917    Function getpass() from module 'getpass-gnu':
1918      Read a password of arbitrary length from /dev/tty or stdin.  */
1919 # if 0
1920 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1921 #   undef getpass
1922 #   define getpass rpl_getpass
1923 #  endif
1924 _GL_FUNCDECL_RPL (getpass, char *, (const char *prompt)
1925                                    _GL_ARG_NONNULL ((1)));
1926 _GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
1927 # else
1928 #  if !1
1929 _GL_FUNCDECL_SYS (getpass, char *, (const char *prompt)
1930                                    _GL_ARG_NONNULL ((1)));
1931 #  endif
1932 _GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
1933 # endif
1934 _GL_CXXALIASWARN (getpass);
1935 #elif defined GNULIB_POSIXCHECK
1936 # undef getpass
1937 # if HAVE_RAW_DECL_GETPASS
1938 _GL_WARN_ON_USE (getpass, "getpass is unportable - "
1939                  "use gnulib module getpass or getpass-gnu for portability");
1940 # endif
1941 #endif
1942 
1943 
1944 #if 1
1945 /* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not
1946    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
1947    platforms by defining GNULIB_NAMESPACE::getpid always.  */
1948 # if defined _WIN32 && !defined __CYGWIN__
1949 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1950 #   undef getpid
1951 #   define getpid _getpid
1952 #  endif
1953 _GL_CXXALIAS_MDA (getpid, int, (void));
1954 # else
1955 _GL_CXXALIAS_SYS (getpid, pid_t, (void));
1956 # endif
1957 _GL_CXXALIASWARN (getpid);
1958 #endif
1959 
1960 
1961 #if 0
1962 /* Return the next valid login shell on the system, or NULL when the end of
1963    the list has been reached.  */
1964 # if !1
1965 _GL_FUNCDECL_SYS (getusershell, char *, (void));
1966 # endif
1967 _GL_CXXALIAS_SYS (getusershell, char *, (void));
1968 _GL_CXXALIASWARN (getusershell);
1969 #elif defined GNULIB_POSIXCHECK
1970 # undef getusershell
1971 # if HAVE_RAW_DECL_GETUSERSHELL
1972 _GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
1973                  "use gnulib module getusershell for portability");
1974 # endif
1975 #endif
1976 
1977 #if 0
1978 /* Rewind to pointer that is advanced at each getusershell() call.  */
1979 # if !1
1980 _GL_FUNCDECL_SYS (setusershell, void, (void));
1981 # endif
1982 _GL_CXXALIAS_SYS (setusershell, void, (void));
1983 _GL_CXXALIASWARN (setusershell);
1984 #elif defined GNULIB_POSIXCHECK
1985 # undef setusershell
1986 # if HAVE_RAW_DECL_SETUSERSHELL
1987 _GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
1988                  "use gnulib module getusershell for portability");
1989 # endif
1990 #endif
1991 
1992 #if 0
1993 /* Free the pointer that is advanced at each getusershell() call and
1994    associated resources.  */
1995 # if !1
1996 _GL_FUNCDECL_SYS (endusershell, void, (void));
1997 # endif
1998 _GL_CXXALIAS_SYS (endusershell, void, (void));
1999 _GL_CXXALIASWARN (endusershell);
2000 #elif defined GNULIB_POSIXCHECK
2001 # undef endusershell
2002 # if HAVE_RAW_DECL_ENDUSERSHELL
2003 _GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
2004                  "use gnulib module getusershell for portability");
2005 # endif
2006 #endif
2007 
2008 
2009 #if 0
2010 /* Determine whether group id is in calling user's group list.  */
2011 # if !1
2012 _GL_FUNCDECL_SYS (group_member, int, (gid_t gid));
2013 # endif
2014 _GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
2015 _GL_CXXALIASWARN (group_member);
2016 #elif defined GNULIB_POSIXCHECK
2017 # undef group_member
2018 # if HAVE_RAW_DECL_GROUP_MEMBER
2019 _GL_WARN_ON_USE (group_member, "group_member is unportable - "
2020                  "use gnulib module group-member for portability");
2021 # endif
2022 #endif
2023 
2024 
2025 #if 0
2026 # if 0
2027 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2028 #   undef isatty
2029 #   define isatty rpl_isatty
2030 #  endif
2031 _GL_FUNCDECL_RPL (isatty, int, (int fd));
2032 _GL_CXXALIAS_RPL (isatty, int, (int fd));
2033 # elif defined _WIN32 && !defined __CYGWIN__
2034 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2035 #   undef isatty
2036 #   define isatty _isatty
2037 #  endif
2038 _GL_CXXALIAS_MDA (isatty, int, (int fd));
2039 # else
2040 _GL_CXXALIAS_SYS (isatty, int, (int fd));
2041 # endif
2042 _GL_CXXALIASWARN (isatty);
2043 #elif defined GNULIB_POSIXCHECK
2044 # undef isatty
2045 # if HAVE_RAW_DECL_ISATTY
2046 _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
2047                  "use gnulib module isatty for portability");
2048 # endif
2049 #elif 1
2050 /* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not
2051    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
2052    platforms by defining GNULIB_NAMESPACE::isatty always.  */
2053 # if defined _WIN32 && !defined __CYGWIN__
2054 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2055 #   undef isatty
2056 #   define isatty _isatty
2057 #  endif
2058 _GL_CXXALIAS_MDA (isatty, int, (int fd));
2059 # else
2060 _GL_CXXALIAS_SYS (isatty, int, (int fd));
2061 # endif
2062 _GL_CXXALIASWARN (isatty);
2063 #endif
2064 
2065 
2066 #if 0
2067 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
2068    to GID (if GID is not -1).  Do not follow symbolic links.
2069    Return 0 if successful, otherwise -1 and errno set.
2070    See the POSIX:2008 specification
2071    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>.  */
2072 # if 0
2073 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2074 #   undef lchown
2075 #   define lchown rpl_lchown
2076 #  endif
2077 _GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
2078                                _GL_ARG_NONNULL ((1)));
2079 _GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
2080 # else
2081 #  if !1
2082 _GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
2083                                _GL_ARG_NONNULL ((1)));
2084 #  endif
2085 _GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
2086 # endif
2087 _GL_CXXALIASWARN (lchown);
2088 #elif defined GNULIB_POSIXCHECK
2089 # undef lchown
2090 # if HAVE_RAW_DECL_LCHOWN
2091 _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
2092                  "use gnulib module lchown for portability");
2093 # endif
2094 #endif
2095 
2096 
2097 #if 0
2098 /* Create a new hard link for an existing file.
2099    Return 0 if successful, otherwise -1 and errno set.
2100    See POSIX:2008 specification
2101    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>.  */
2102 # if 0
2103 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2104 #   define link rpl_link
2105 #  endif
2106 _GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
2107                              _GL_ARG_NONNULL ((1, 2)));
2108 _GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
2109 # else
2110 #  if !1
2111 _GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
2112                              _GL_ARG_NONNULL ((1, 2)));
2113 #  endif
2114 _GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
2115 # endif
2116 _GL_CXXALIASWARN (link);
2117 #elif defined GNULIB_POSIXCHECK
2118 # undef link
2119 # if HAVE_RAW_DECL_LINK
2120 _GL_WARN_ON_USE (link, "link is unportable - "
2121                  "use gnulib module link for portability");
2122 # endif
2123 #endif
2124 
2125 
2126 #if 0
2127 /* Create a new hard link for an existing file, relative to two
2128    directories.  FLAG controls whether symlinks are followed.
2129    Return 0 if successful, otherwise -1 and errno set.  */
2130 # if 0
2131 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2132 #   undef linkat
2133 #   define linkat rpl_linkat
2134 #  endif
2135 _GL_FUNCDECL_RPL (linkat, int,
2136                   (int fd1, const char *path1, int fd2, const char *path2,
2137                    int flag)
2138                   _GL_ARG_NONNULL ((2, 4)));
2139 _GL_CXXALIAS_RPL (linkat, int,
2140                   (int fd1, const char *path1, int fd2, const char *path2,
2141                    int flag));
2142 # else
2143 #  if !1
2144 _GL_FUNCDECL_SYS (linkat, int,
2145                   (int fd1, const char *path1, int fd2, const char *path2,
2146                    int flag)
2147                   _GL_ARG_NONNULL ((2, 4)));
2148 #  endif
2149 _GL_CXXALIAS_SYS (linkat, int,
2150                   (int fd1, const char *path1, int fd2, const char *path2,
2151                    int flag));
2152 # endif
2153 _GL_CXXALIASWARN (linkat);
2154 #elif defined GNULIB_POSIXCHECK
2155 # undef linkat
2156 # if HAVE_RAW_DECL_LINKAT
2157 _GL_WARN_ON_USE (linkat, "linkat is unportable - "
2158                  "use gnulib module linkat for portability");
2159 # endif
2160 #endif
2161 
2162 
2163 #if 0
2164 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
2165    Return the new offset if successful, otherwise -1 and errno set.
2166    See the POSIX:2008 specification
2167    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>.  */
2168 # if 0
2169 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2170 #   define lseek rpl_lseek
2171 #  endif
2172 _GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
2173 _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
2174 # elif defined _WIN32 && !defined __CYGWIN__
2175 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2176 #   undef lseek
2177 #   define lseek _lseek
2178 #  endif
2179 _GL_CXXALIAS_MDA (lseek, off_t, (int fd, off_t offset, int whence));
2180 # else
2181 _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
2182 # endif
2183 _GL_CXXALIASWARN (lseek);
2184 #elif defined GNULIB_POSIXCHECK
2185 # undef lseek
2186 # if HAVE_RAW_DECL_LSEEK
2187 _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
2188                  "systems - use gnulib module lseek for portability");
2189 # endif
2190 #elif 1
2191 /* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not
2192    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
2193    platforms by defining GNULIB_NAMESPACE::lseek always.  */
2194 # if defined _WIN32 && !defined __CYGWIN__
2195 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2196 #   undef lseek
2197 #   define lseek _lseek
2198 #  endif
2199 _GL_CXXALIAS_MDA (lseek, long, (int fd, long offset, int whence));
2200 # else
2201 _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
2202 # endif
2203 _GL_CXXALIASWARN (lseek);
2204 #endif
2205 
2206 
2207 #if 0
2208 /* Create a pipe, defaulting to O_BINARY mode.
2209    Store the read-end as fd[0] and the write-end as fd[1].
2210    Return 0 upon success, or -1 with errno set upon failure.  */
2211 # if !1
2212 _GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
2213 # endif
2214 _GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
2215 _GL_CXXALIASWARN (pipe);
2216 #elif defined GNULIB_POSIXCHECK
2217 # undef pipe
2218 # if HAVE_RAW_DECL_PIPE
2219 _GL_WARN_ON_USE (pipe, "pipe is unportable - "
2220                  "use gnulib module pipe-posix for portability");
2221 # endif
2222 #endif
2223 
2224 
2225 #if 0
2226 /* Create a pipe, applying the given flags when opening the read-end of the
2227    pipe and the write-end of the pipe.
2228    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
2229    and O_TEXT, O_BINARY (defined in "binary-io.h").
2230    Store the read-end as fd[0] and the write-end as fd[1].
2231    Return 0 upon success, or -1 with errno set upon failure.
2232    See also the Linux man page at
2233    <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>.  */
2234 # if 1
2235 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2236 #   define pipe2 rpl_pipe2
2237 #  endif
2238 _GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
2239 _GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
2240 # else
2241 _GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
2242 _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
2243 # endif
2244 _GL_CXXALIASWARN (pipe2);
2245 #elif defined GNULIB_POSIXCHECK
2246 # undef pipe2
2247 # if HAVE_RAW_DECL_PIPE2
2248 _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
2249                  "use gnulib module pipe2 for portability");
2250 # endif
2251 #endif
2252 
2253 
2254 #if 0
2255 /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
2256    Return the number of bytes placed into BUF if successful, otherwise
2257    set errno and return -1.  0 indicates EOF.
2258    See the POSIX:2008 specification
2259    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>.  */
2260 # if 0
2261 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2262 #   undef pread
2263 #   define pread rpl_pread
2264 #  endif
2265 _GL_FUNCDECL_RPL (pread, ssize_t,
2266                   (int fd, void *buf, size_t bufsize, off_t offset)
2267                   _GL_ARG_NONNULL ((2)));
2268 _GL_CXXALIAS_RPL (pread, ssize_t,
2269                   (int fd, void *buf, size_t bufsize, off_t offset));
2270 # else
2271 #  if !1
2272 _GL_FUNCDECL_SYS (pread, ssize_t,
2273                   (int fd, void *buf, size_t bufsize, off_t offset)
2274                   _GL_ARG_NONNULL ((2)));
2275 #  endif
2276 _GL_CXXALIAS_SYS (pread, ssize_t,
2277                   (int fd, void *buf, size_t bufsize, off_t offset));
2278 # endif
2279 _GL_CXXALIASWARN (pread);
2280 #elif defined GNULIB_POSIXCHECK
2281 # undef pread
2282 # if HAVE_RAW_DECL_PREAD
2283 _GL_WARN_ON_USE (pread, "pread is unportable - "
2284                  "use gnulib module pread for portability");
2285 # endif
2286 #endif
2287 
2288 
2289 #if 0
2290 /* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
2291    Return the number of bytes written if successful, otherwise
2292    set errno and return -1.  0 indicates nothing written.  See the
2293    POSIX:2008 specification
2294    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>.  */
2295 # if 0
2296 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2297 #   undef pwrite
2298 #   define pwrite rpl_pwrite
2299 #  endif
2300 _GL_FUNCDECL_RPL (pwrite, ssize_t,
2301                   (int fd, const void *buf, size_t bufsize, off_t offset)
2302                   _GL_ARG_NONNULL ((2)));
2303 _GL_CXXALIAS_RPL (pwrite, ssize_t,
2304                   (int fd, const void *buf, size_t bufsize, off_t offset));
2305 # else
2306 #  if !1
2307 _GL_FUNCDECL_SYS (pwrite, ssize_t,
2308                   (int fd, const void *buf, size_t bufsize, off_t offset)
2309                   _GL_ARG_NONNULL ((2)));
2310 #  endif
2311 _GL_CXXALIAS_SYS (pwrite, ssize_t,
2312                   (int fd, const void *buf, size_t bufsize, off_t offset));
2313 # endif
2314 _GL_CXXALIASWARN (pwrite);
2315 #elif defined GNULIB_POSIXCHECK
2316 # undef pwrite
2317 # if HAVE_RAW_DECL_PWRITE
2318 _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
2319                  "use gnulib module pwrite for portability");
2320 # endif
2321 #endif
2322 
2323 
2324 #if 0
2325 /* Read up to COUNT bytes from file descriptor FD into the buffer starting
2326    at BUF.  See the POSIX:2008 specification
2327    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>.  */
2328 # if 0
2329 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2330 #   undef read
2331 #   define read rpl_read
2332 #  endif
2333 _GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
2334                                  _GL_ARG_NONNULL ((2)));
2335 _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
2336 # elif defined _WIN32 && !defined __CYGWIN__
2337 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2338 #   undef read
2339 #   define read _read
2340 #  endif
2341 _GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count));
2342 # else
2343 _GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
2344 # endif
2345 _GL_CXXALIASWARN (read);
2346 #elif 1
2347 /* On native Windows, map 'read' to '_read', so that -loldnames is not
2348    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
2349    platforms by defining GNULIB_NAMESPACE::read always.  */
2350 # if defined _WIN32 && !defined __CYGWIN__
2351 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2352 #   undef read
2353 #   define read _read
2354 #  endif
2355 #  ifdef __MINGW32__
2356 _GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count));
2357 #  else
2358 _GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count));
2359 #  endif
2360 # else
2361 _GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
2362 # endif
2363 _GL_CXXALIASWARN (read);
2364 #endif
2365 
2366 
2367 #if 0
2368 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
2369    bytes of it into BUF.  Return the number of bytes placed into BUF if
2370    successful, otherwise -1 and errno set.
2371    See the POSIX:2008 specification
2372    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>.  */
2373 # if 0
2374 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2375 #   define readlink rpl_readlink
2376 #  endif
2377 _GL_FUNCDECL_RPL (readlink, ssize_t,
2378                   (const char *restrict file,
2379                    char *restrict buf, size_t bufsize)
2380                   _GL_ARG_NONNULL ((1, 2)));
2381 _GL_CXXALIAS_RPL (readlink, ssize_t,
2382                   (const char *restrict file,
2383                    char *restrict buf, size_t bufsize));
2384 # else
2385 #  if !1
2386 _GL_FUNCDECL_SYS (readlink, ssize_t,
2387                   (const char *restrict file,
2388                    char *restrict buf, size_t bufsize)
2389                   _GL_ARG_NONNULL ((1, 2)));
2390 #  endif
2391 _GL_CXXALIAS_SYS (readlink, ssize_t,
2392                   (const char *restrict file,
2393                    char *restrict buf, size_t bufsize));
2394 # endif
2395 _GL_CXXALIASWARN (readlink);
2396 #elif defined GNULIB_POSIXCHECK
2397 # undef readlink
2398 # if HAVE_RAW_DECL_READLINK
2399 _GL_WARN_ON_USE (readlink, "readlink is unportable - "
2400                  "use gnulib module readlink for portability");
2401 # endif
2402 #endif
2403 
2404 
2405 #if 0
2406 # if 0
2407 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2408 #   define readlinkat rpl_readlinkat
2409 #  endif
2410 _GL_FUNCDECL_RPL (readlinkat, ssize_t,
2411                   (int fd, char const *restrict file,
2412                    char *restrict buf, size_t len)
2413                   _GL_ARG_NONNULL ((2, 3)));
2414 _GL_CXXALIAS_RPL (readlinkat, ssize_t,
2415                   (int fd, char const *restrict file,
2416                    char *restrict buf, size_t len));
2417 # else
2418 #  if !1
2419 _GL_FUNCDECL_SYS (readlinkat, ssize_t,
2420                   (int fd, char const *restrict file,
2421                    char *restrict buf, size_t len)
2422                   _GL_ARG_NONNULL ((2, 3)));
2423 #  endif
2424 _GL_CXXALIAS_SYS (readlinkat, ssize_t,
2425                   (int fd, char const *restrict file,
2426                    char *restrict buf, size_t len));
2427 # endif
2428 _GL_CXXALIASWARN (readlinkat);
2429 #elif defined GNULIB_POSIXCHECK
2430 # undef readlinkat
2431 # if HAVE_RAW_DECL_READLINKAT
2432 _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
2433                  "use gnulib module readlinkat for portability");
2434 # endif
2435 #endif
2436 
2437 
2438 #if 0
2439 /* Remove the directory DIR.  */
2440 # if 0
2441 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2442 #   define rmdir rpl_rmdir
2443 #  endif
2444 _GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
2445 _GL_CXXALIAS_RPL (rmdir, int, (char const *name));
2446 # elif defined _WIN32 && !defined __CYGWIN__
2447 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2448 #   undef rmdir
2449 #   define rmdir _rmdir
2450 #  endif
2451 _GL_CXXALIAS_MDA (rmdir, int, (char const *name));
2452 # else
2453 _GL_CXXALIAS_SYS (rmdir, int, (char const *name));
2454 # endif
2455 _GL_CXXALIASWARN (rmdir);
2456 #elif defined GNULIB_POSIXCHECK
2457 # undef rmdir
2458 # if HAVE_RAW_DECL_RMDIR
2459 _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
2460                  "use gnulib module rmdir for portability");
2461 # endif
2462 #elif 1
2463 /* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not
2464    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
2465    platforms by defining GNULIB_NAMESPACE::rmdir always.  */
2466 # if defined _WIN32 && !defined __CYGWIN__
2467 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2468 #   undef rmdir
2469 #   define rmdir _rmdir
2470 #  endif
2471 _GL_CXXALIAS_MDA (rmdir, int, (char const *name));
2472 # else
2473 _GL_CXXALIAS_SYS (rmdir, int, (char const *name));
2474 # endif
2475 _GL_CXXALIASWARN (rmdir);
2476 #endif
2477 
2478 
2479 #if 0
2480 /* Set the host name of the machine.
2481    The host name may or may not be fully qualified.
2482 
2483    Put LEN bytes of NAME into the host name.
2484    Return 0 if successful, otherwise, set errno and return -1.
2485 
2486    Platforms with no ability to set the hostname return -1 and set
2487    errno = ENOSYS.  */
2488 # if !1 || !1
2489 _GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
2490                                     _GL_ARG_NONNULL ((1)));
2491 # endif
2492 /* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
2493    and FreeBSD 6.4 the second parameter is int.  On Solaris 11
2494    2011-10, the first parameter is not const.  */
2495 _GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
2496 _GL_CXXALIASWARN (sethostname);
2497 #elif defined GNULIB_POSIXCHECK
2498 # undef sethostname
2499 # if HAVE_RAW_DECL_SETHOSTNAME
2500 _GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
2501                  "use gnulib module sethostname for portability");
2502 # endif
2503 #endif
2504 
2505 
2506 #if 0
2507 /* Pause the execution of the current thread for N seconds.
2508    Returns the number of seconds left to sleep.
2509    See the POSIX:2008 specification
2510    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>.  */
2511 # if 0
2512 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2513 #   undef sleep
2514 #   define sleep rpl_sleep
2515 #  endif
2516 _GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
2517 _GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
2518 # else
2519 #  if !1
2520 _GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
2521 #  endif
2522 _GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
2523 # endif
2524 _GL_CXXALIASWARN (sleep);
2525 #elif defined GNULIB_POSIXCHECK
2526 # undef sleep
2527 # if HAVE_RAW_DECL_SLEEP
2528 _GL_WARN_ON_USE (sleep, "sleep is unportable - "
2529                  "use gnulib module sleep for portability");
2530 # endif
2531 #endif
2532 
2533 
2534 #if 1
2535 /* On native Windows, map 'swab' to '_swab', so that -loldnames is not
2536    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
2537    platforms by defining GNULIB_NAMESPACE::creat always.  */
2538 # if defined _WIN32 && !defined __CYGWIN__
2539 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2540 #   undef swab
2541 #   define swab _swab
2542 #  endif
2543 _GL_CXXALIAS_MDA (swab, void, (char *from, char *to, int n));
2544 # else
2545 _GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));
2546 # endif
2547 _GL_CXXALIASWARN (swab);
2548 #endif
2549 
2550 
2551 #if 0
2552 # if 0
2553 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2554 #   undef symlink
2555 #   define symlink rpl_symlink
2556 #  endif
2557 _GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
2558                                 _GL_ARG_NONNULL ((1, 2)));
2559 _GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
2560 # else
2561 #  if !1
2562 _GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
2563                                 _GL_ARG_NONNULL ((1, 2)));
2564 #  endif
2565 _GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
2566 # endif
2567 _GL_CXXALIASWARN (symlink);
2568 #elif defined GNULIB_POSIXCHECK
2569 # undef symlink
2570 # if HAVE_RAW_DECL_SYMLINK
2571 _GL_WARN_ON_USE (symlink, "symlink is not portable - "
2572                  "use gnulib module symlink for portability");
2573 # endif
2574 #endif
2575 
2576 
2577 #if 0
2578 # if 0
2579 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2580 #   undef symlinkat
2581 #   define symlinkat rpl_symlinkat
2582 #  endif
2583 _GL_FUNCDECL_RPL (symlinkat, int,
2584                   (char const *contents, int fd, char const *file)
2585                   _GL_ARG_NONNULL ((1, 3)));
2586 _GL_CXXALIAS_RPL (symlinkat, int,
2587                   (char const *contents, int fd, char const *file));
2588 # else
2589 #  if !1
2590 _GL_FUNCDECL_SYS (symlinkat, int,
2591                   (char const *contents, int fd, char const *file)
2592                   _GL_ARG_NONNULL ((1, 3)));
2593 #  endif
2594 _GL_CXXALIAS_SYS (symlinkat, int,
2595                   (char const *contents, int fd, char const *file));
2596 # endif
2597 _GL_CXXALIASWARN (symlinkat);
2598 #elif defined GNULIB_POSIXCHECK
2599 # undef symlinkat
2600 # if HAVE_RAW_DECL_SYMLINKAT
2601 _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
2602                  "use gnulib module symlinkat for portability");
2603 # endif
2604 #endif
2605 
2606 
2607 #if 0
2608 /* Change the size of the file designated by FILENAME to become equal to LENGTH.
2609    Return 0 if successful, otherwise -1 and errno set.
2610    See the POSIX:2008 specification
2611    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>.  */
2612 # if 0
2613 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2614 #   undef truncate
2615 #   define truncate rpl_truncate
2616 #  endif
2617 _GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
2618                                  _GL_ARG_NONNULL ((1)));
2619 _GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
2620 # else
2621 #  if !1
2622 _GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
2623                                  _GL_ARG_NONNULL ((1)));
2624 #  endif
2625 _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
2626 # endif
2627 _GL_CXXALIASWARN (truncate);
2628 #elif defined GNULIB_POSIXCHECK
2629 # undef truncate
2630 # if HAVE_RAW_DECL_TRUNCATE
2631 _GL_WARN_ON_USE (truncate, "truncate is unportable - "
2632                  "use gnulib module truncate for portability");
2633 # endif
2634 #endif
2635 
2636 
2637 #if 0
2638 /* Store at most BUFLEN characters of the pathname of the terminal FD is
2639    open on in BUF.  Return 0 on success, otherwise an error number.  */
2640 # if 0
2641 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2642 #   undef ttyname_r
2643 #   define ttyname_r rpl_ttyname_r
2644 #  endif
2645 _GL_FUNCDECL_RPL (ttyname_r, int,
2646                   (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
2647 _GL_CXXALIAS_RPL (ttyname_r, int,
2648                   (int fd, char *buf, size_t buflen));
2649 # else
2650 #  if !1
2651 _GL_FUNCDECL_SYS (ttyname_r, int,
2652                   (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
2653 #  endif
2654 _GL_CXXALIAS_SYS (ttyname_r, int,
2655                   (int fd, char *buf, size_t buflen));
2656 # endif
2657 _GL_CXXALIASWARN (ttyname_r);
2658 #elif defined GNULIB_POSIXCHECK
2659 # undef ttyname_r
2660 # if HAVE_RAW_DECL_TTYNAME_R
2661 _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
2662                  "use gnulib module ttyname_r for portability");
2663 # endif
2664 #endif
2665 
2666 
2667 #if 0
2668 # if 0
2669 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2670 #   undef unlink
2671 #   define unlink rpl_unlink
2672 #  endif
2673 _GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
2674 _GL_CXXALIAS_RPL (unlink, int, (char const *file));
2675 # elif defined _WIN32 && !defined __CYGWIN__
2676 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2677 #   undef unlink
2678 #   define unlink _unlink
2679 #  endif
2680 _GL_CXXALIAS_MDA (unlink, int, (char const *file));
2681 # else
2682 _GL_CXXALIAS_SYS (unlink, int, (char const *file));
2683 # endif
2684 _GL_CXXALIASWARN (unlink);
2685 #elif defined GNULIB_POSIXCHECK
2686 # undef unlink
2687 # if HAVE_RAW_DECL_UNLINK
2688 _GL_WARN_ON_USE (unlink, "unlink is not portable - "
2689                  "use gnulib module unlink for portability");
2690 # endif
2691 #elif 1
2692 /* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not
2693    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
2694    platforms by defining GNULIB_NAMESPACE::unlink always.  */
2695 # if defined _WIN32 && !defined __CYGWIN__
2696 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2697 #   undef unlink
2698 #   define unlink _unlink
2699 #  endif
2700 _GL_CXXALIAS_MDA (unlink, int, (char const *file));
2701 # else
2702 _GL_CXXALIAS_SYS (unlink, int, (char const *file));
2703 # endif
2704 _GL_CXXALIASWARN (unlink);
2705 #endif
2706 
2707 
2708 #if 0
2709 # if 0
2710 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2711 #   undef unlinkat
2712 #   define unlinkat rpl_unlinkat
2713 #  endif
2714 _GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
2715                                  _GL_ARG_NONNULL ((2)));
2716 _GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
2717 # else
2718 #  if !1
2719 _GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
2720                                  _GL_ARG_NONNULL ((2)));
2721 #  endif
2722 _GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
2723 # endif
2724 _GL_CXXALIASWARN (unlinkat);
2725 #elif defined GNULIB_POSIXCHECK
2726 # undef unlinkat
2727 # if HAVE_RAW_DECL_UNLINKAT
2728 _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
2729                  "use gnulib module unlinkat for portability");
2730 # endif
2731 #endif
2732 
2733 
2734 #if 0
2735 /* Pause the execution of the current thread for N microseconds.
2736    Returns 0 on completion, or -1 on range error.
2737    See the POSIX:2001 specification
2738    <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>.  */
2739 # if 0
2740 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2741 #   undef usleep
2742 #   define usleep rpl_usleep
2743 #  endif
2744 _GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
2745 _GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
2746 # else
2747 #  if !1
2748 _GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
2749 #  endif
2750 /* Need to cast, because on Haiku, the first parameter is
2751                                      unsigned int n.  */
2752 _GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n));
2753 # endif
2754 _GL_CXXALIASWARN (usleep);
2755 #elif defined GNULIB_POSIXCHECK
2756 # undef usleep
2757 # if HAVE_RAW_DECL_USLEEP
2758 _GL_WARN_ON_USE (usleep, "usleep is unportable - "
2759                  "use gnulib module usleep for portability");
2760 # endif
2761 #endif
2762 
2763 
2764 #if 0
2765 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
2766    See the POSIX:2008 specification
2767    <https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>.  */
2768 # if 0
2769 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2770 #   undef write
2771 #   define write rpl_write
2772 #  endif
2773 _GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
2774                                   _GL_ARG_NONNULL ((2)));
2775 _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
2776 # elif defined _WIN32 && !defined __CYGWIN__
2777 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2778 #   undef write
2779 #   define write _write
2780 #  endif
2781 _GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count));
2782 # else
2783 _GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
2784 # endif
2785 _GL_CXXALIASWARN (write);
2786 #elif 1
2787 /* On native Windows, map 'write' to '_write', so that -loldnames is not
2788    required.  In C++ with GNULIB_NAMESPACE, avoid differences between
2789    platforms by defining GNULIB_NAMESPACE::write always.  */
2790 # if defined _WIN32 && !defined __CYGWIN__
2791 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2792 #   undef write
2793 #   define write _write
2794 #  endif
2795 #  ifdef __MINGW32__
2796 _GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count));
2797 #  else
2798 _GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count));
2799 #  endif
2800 # else
2801 _GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
2802 # endif
2803 _GL_CXXALIASWARN (write);
2804 #endif
2805 
2806 _GL_INLINE_HEADER_END
2807 
2808 #endif /* _GL_UNISTD_H */
2809 #endif /* _GL_INCLUDING_UNISTD_H */
2810 #endif /* _GL_UNISTD_H */
2811