update devspec.en_US/1.0.general.md.
[devspec.git] / devspec.en_US / project / recutils / lib / unistd.h
blobc0812057a3838d35bc227f2a5084df81234cce90
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* Substitute for and wrapper around <unistd.h>.
3 Copyright (C) 2003-2019 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
10 This program 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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, see <https://www.gnu.org/licenses/>. */
18 #ifndef _GL_UNISTD_H
20 #if __GNUC__ >= 3
21 #pragma GCC system_header
22 #endif
25 #ifdef _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. */
32 #include_next <unistd.h>
34 #else
35 /* Normal invocation convention. */
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
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
52 #if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
53 #define _GL_UNISTD_H
55 /* NetBSD 5.0 mis-defines NULL. Also get size_t. */
56 #include <stddef.h>
58 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
59 /* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include
60 it before we #define unlink rpl_unlink. */
61 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */
62 /* But avoid namespace pollution on glibc systems. */
63 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
64 || ((0 || defined GNULIB_POSIXCHECK) \
65 && (defined _WIN32 && ! defined __CYGWIN__)) \
66 || ((0 || defined GNULIB_POSIXCHECK) \
67 && defined __CYGWIN__)) \
68 && ! defined __GLIBC__
69 # include <stdio.h>
70 #endif
72 /* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */
73 /* But avoid namespace pollution on glibc systems. */
74 #if (0 || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \
75 && ! defined __GLIBC__
76 # include <fcntl.h>
77 #endif
79 /* mingw fails to declare _exit in <unistd.h>. */
80 /* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
81 <unistd.h>. */
82 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */
83 /* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is
84 included here. */
85 /* But avoid namespace pollution on glibc systems. */
86 #if !defined __GLIBC__ && !defined __osf__
87 # define __need_system_stdlib_h
88 # include <stdlib.h>
89 # undef __need_system_stdlib_h
90 #endif
92 /* Native Windows platforms declare chdir, getcwd, rmdir in
93 <io.h> and/or <direct.h>, not in <unistd.h>.
94 They also declare access(), chmod(), close(), dup(), dup2(), isatty(),
95 lseek(), read(), unlink(), write() in <io.h>. */
96 #if ((1 || 0 || 1 \
97 || defined GNULIB_POSIXCHECK) \
98 && (defined _WIN32 && ! defined __CYGWIN__))
99 # include <io.h> /* mingw32, mingw64 */
100 # include <direct.h> /* mingw64, MSVC 9 */
101 #elif (1 || 0 || 1 || 0 \
102 || 1 || 0 || 0 || 0 \
103 || defined GNULIB_POSIXCHECK) \
104 && (defined _WIN32 && ! defined __CYGWIN__)
105 # include <io.h>
106 #endif
108 /* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
109 NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */
110 /* But avoid namespace pollution on glibc systems. */
111 #if ((0 && (defined _AIX || defined __osf__)) \
112 || (0 && defined __TANDEM)) \
113 && !defined __GLIBC__
114 # include <netdb.h>
115 #endif
117 /* MSVC defines off_t in <sys/types.h>.
118 May also define off_t to a 64-bit type on native Windows. */
119 #if !1 || 0
120 /* Get off_t. */
121 # include <sys/types.h>
122 #endif
124 #if (0 || 0 \
125 || 1 || 0 \
126 || 0 || 0 || defined GNULIB_POSIXCHECK)
127 /* Get ssize_t. */
128 # include <sys/types.h>
129 #endif
131 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
132 /* C++ compatible function declaration macros.
133 Copyright (C) 2010-2019 Free Software Foundation, Inc.
135 This program is free software: you can redistribute it and/or modify it
136 under the terms of the GNU General Public License as published
137 by the Free Software Foundation; either version 3 of the License, or
138 (at your option) any later version.
140 This program is distributed in the hope that it will be useful,
141 but WITHOUT ANY WARRANTY; without even the implied warranty of
142 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
143 General Public License for more details.
145 You should have received a copy of the GNU General Public License
146 along with this program. If not, see <https://www.gnu.org/licenses/>. */
148 #ifndef _GL_CXXDEFS_H
149 #define _GL_CXXDEFS_H
151 /* Begin/end the GNULIB_NAMESPACE namespace. */
152 #if defined __cplusplus && defined GNULIB_NAMESPACE
153 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
154 # define _GL_END_NAMESPACE }
155 #else
156 # define _GL_BEGIN_NAMESPACE
157 # define _GL_END_NAMESPACE
158 #endif
160 /* The three most frequent use cases of these macros are:
162 * For providing a substitute for a function that is missing on some
163 platforms, but is declared and works fine on the platforms on which
164 it exists:
166 #if @GNULIB_FOO@
167 # if !@HAVE_FOO@
168 _GL_FUNCDECL_SYS (foo, ...);
169 # endif
170 _GL_CXXALIAS_SYS (foo, ...);
171 _GL_CXXALIASWARN (foo);
172 #elif defined GNULIB_POSIXCHECK
174 #endif
176 * For providing a replacement for a function that exists on all platforms,
177 but is broken/insufficient and needs to be replaced on some platforms:
179 #if @GNULIB_FOO@
180 # if @REPLACE_FOO@
181 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
182 # undef foo
183 # define foo rpl_foo
184 # endif
185 _GL_FUNCDECL_RPL (foo, ...);
186 _GL_CXXALIAS_RPL (foo, ...);
187 # else
188 _GL_CXXALIAS_SYS (foo, ...);
189 # endif
190 _GL_CXXALIASWARN (foo);
191 #elif defined GNULIB_POSIXCHECK
193 #endif
195 * For providing a replacement for a function that exists on some platforms
196 but is broken/insufficient and needs to be replaced on some of them and
197 is additionally either missing or undeclared on some other platforms:
199 #if @GNULIB_FOO@
200 # if @REPLACE_FOO@
201 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
202 # undef foo
203 # define foo rpl_foo
204 # endif
205 _GL_FUNCDECL_RPL (foo, ...);
206 _GL_CXXALIAS_RPL (foo, ...);
207 # else
208 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
209 _GL_FUNCDECL_SYS (foo, ...);
210 # endif
211 _GL_CXXALIAS_SYS (foo, ...);
212 # endif
213 _GL_CXXALIASWARN (foo);
214 #elif defined GNULIB_POSIXCHECK
216 #endif
219 /* _GL_EXTERN_C declaration;
220 performs the declaration with C linkage. */
221 #if defined __cplusplus
222 # define _GL_EXTERN_C extern "C"
223 #else
224 # define _GL_EXTERN_C extern
225 #endif
227 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
228 declares a replacement function, named rpl_func, with the given prototype,
229 consisting of return type, parameters, and attributes.
230 Example:
231 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
232 _GL_ARG_NONNULL ((1)));
234 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
235 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
236 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
237 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
239 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
240 declares the system function, named func, with the given prototype,
241 consisting of return type, parameters, and attributes.
242 Example:
243 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
244 _GL_ARG_NONNULL ((1)));
246 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
247 _GL_EXTERN_C rettype func parameters_and_attributes
249 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
250 declares a C++ alias called GNULIB_NAMESPACE::func
251 that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
252 Example:
253 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
255 Wrapping rpl_func in an object with an inline conversion operator
256 avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
257 actually used in the program. */
258 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
259 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
260 #if defined __cplusplus && defined GNULIB_NAMESPACE
261 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
262 namespace GNULIB_NAMESPACE \
264 static const struct _gl_ ## func ## _wrapper \
266 typedef rettype (*type) parameters; \
268 inline operator type () const \
270 return ::rpl_func; \
272 } func = {}; \
274 _GL_EXTERN_C int _gl_cxxalias_dummy
275 #else
276 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
277 _GL_EXTERN_C int _gl_cxxalias_dummy
278 #endif
280 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
281 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
282 except that the C function rpl_func may have a slightly different
283 declaration. A cast is used to silence the "invalid conversion" error
284 that would otherwise occur. */
285 #if defined __cplusplus && defined GNULIB_NAMESPACE
286 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
287 namespace GNULIB_NAMESPACE \
289 static const struct _gl_ ## func ## _wrapper \
291 typedef rettype (*type) parameters; \
293 inline operator type () const \
295 return reinterpret_cast<type>(::rpl_func); \
297 } func = {}; \
299 _GL_EXTERN_C int _gl_cxxalias_dummy
300 #else
301 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
302 _GL_EXTERN_C int _gl_cxxalias_dummy
303 #endif
305 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
306 declares a C++ alias called GNULIB_NAMESPACE::func
307 that redirects to the system provided function func, if GNULIB_NAMESPACE
308 is defined.
309 Example:
310 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
312 Wrapping func in an object with an inline conversion operator
313 avoids a reference to func unless GNULIB_NAMESPACE::func is
314 actually used in the program. */
315 #if defined __cplusplus && defined GNULIB_NAMESPACE
316 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
317 namespace GNULIB_NAMESPACE \
319 static const struct _gl_ ## func ## _wrapper \
321 typedef rettype (*type) parameters; \
323 inline operator type () const \
325 return ::func; \
327 } func = {}; \
329 _GL_EXTERN_C int _gl_cxxalias_dummy
330 #else
331 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
332 _GL_EXTERN_C int _gl_cxxalias_dummy
333 #endif
335 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
336 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
337 except that the C function func may have a slightly different declaration.
338 A cast is used to silence the "invalid conversion" error that would
339 otherwise occur. */
340 #if defined __cplusplus && defined GNULIB_NAMESPACE
341 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
342 namespace GNULIB_NAMESPACE \
344 static const struct _gl_ ## func ## _wrapper \
346 typedef rettype (*type) parameters; \
348 inline operator type () const \
350 return reinterpret_cast<type>(::func); \
352 } func = {}; \
354 _GL_EXTERN_C int _gl_cxxalias_dummy
355 #else
356 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
357 _GL_EXTERN_C int _gl_cxxalias_dummy
358 #endif
360 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
361 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
362 except that the C function is picked among a set of overloaded functions,
363 namely the one with rettype2 and parameters2. Two consecutive casts
364 are used to silence the "cannot find a match" and "invalid conversion"
365 errors that would otherwise occur. */
366 #if defined __cplusplus && defined GNULIB_NAMESPACE
367 /* The outer cast must be a reinterpret_cast.
368 The inner cast: When the function is defined as a set of overloaded
369 functions, it works as a static_cast<>, choosing the designated variant.
370 When the function is defined as a single variant, it works as a
371 reinterpret_cast<>. The parenthesized cast syntax works both ways. */
372 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
373 namespace GNULIB_NAMESPACE \
375 static const struct _gl_ ## func ## _wrapper \
377 typedef rettype (*type) parameters; \
379 inline operator type () const \
381 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
383 } func = {}; \
385 _GL_EXTERN_C int _gl_cxxalias_dummy
386 #else
387 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
388 _GL_EXTERN_C int _gl_cxxalias_dummy
389 #endif
391 /* _GL_CXXALIASWARN (func);
392 causes a warning to be emitted when ::func is used but not when
393 GNULIB_NAMESPACE::func is used. func must be defined without overloaded
394 variants. */
395 #if defined __cplusplus && defined GNULIB_NAMESPACE
396 # define _GL_CXXALIASWARN(func) \
397 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
398 # define _GL_CXXALIASWARN_1(func,namespace) \
399 _GL_CXXALIASWARN_2 (func, namespace)
400 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
401 we enable the warning only when not optimizing. */
402 # if !__OPTIMIZE__
403 # define _GL_CXXALIASWARN_2(func,namespace) \
404 _GL_WARN_ON_USE (func, \
405 "The symbol ::" #func " refers to the system function. " \
406 "Use " #namespace "::" #func " instead.")
407 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
408 # define _GL_CXXALIASWARN_2(func,namespace) \
409 extern __typeof__ (func) func
410 # else
411 # define _GL_CXXALIASWARN_2(func,namespace) \
412 _GL_EXTERN_C int _gl_cxxalias_dummy
413 # endif
414 #else
415 # define _GL_CXXALIASWARN(func) \
416 _GL_EXTERN_C int _gl_cxxalias_dummy
417 #endif
419 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
420 causes a warning to be emitted when the given overloaded variant of ::func
421 is used but not when GNULIB_NAMESPACE::func is used. */
422 #if defined __cplusplus && defined GNULIB_NAMESPACE
423 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
424 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
425 GNULIB_NAMESPACE)
426 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
427 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
428 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
429 we enable the warning only when not optimizing. */
430 # if !__OPTIMIZE__
431 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
432 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
433 "The symbol ::" #func " refers to the system function. " \
434 "Use " #namespace "::" #func " instead.")
435 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
436 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
437 extern __typeof__ (func) func
438 # else
439 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
440 _GL_EXTERN_C int _gl_cxxalias_dummy
441 # endif
442 #else
443 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
444 _GL_EXTERN_C int _gl_cxxalias_dummy
445 #endif
447 #endif /* _GL_CXXDEFS_H */
449 /* The definition of _GL_ARG_NONNULL is copied here. */
450 /* A C macro for declaring that specific arguments must not be NULL.
451 Copyright (C) 2009-2019 Free Software Foundation, Inc.
453 This program is free software: you can redistribute it and/or modify it
454 under the terms of the GNU General Public License as published
455 by the Free Software Foundation; either version 3 of the License, or
456 (at your option) any later version.
458 This program is distributed in the hope that it will be useful,
459 but WITHOUT ANY WARRANTY; without even the implied warranty of
460 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
461 General Public License for more details.
463 You should have received a copy of the GNU General Public License
464 along with this program. If not, see <https://www.gnu.org/licenses/>. */
466 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
467 that the values passed as arguments n, ..., m must be non-NULL pointers.
468 n = 1 stands for the first argument, n = 2 for the second argument etc. */
469 #ifndef _GL_ARG_NONNULL
470 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
471 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
472 # else
473 # define _GL_ARG_NONNULL(params)
474 # endif
475 #endif
477 /* The definition of _GL_WARN_ON_USE is copied here. */
478 /* A C macro for emitting warnings if a function is used.
479 Copyright (C) 2010-2019 Free Software Foundation, Inc.
481 This program is free software: you can redistribute it and/or modify it
482 under the terms of the GNU General Public License as published
483 by the Free Software Foundation; either version 3 of the License, or
484 (at your option) any later version.
486 This program is distributed in the hope that it will be useful,
487 but WITHOUT ANY WARRANTY; without even the implied warranty of
488 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
489 General Public License for more details.
491 You should have received a copy of the GNU General Public License
492 along with this program. If not, see <https://www.gnu.org/licenses/>. */
494 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
495 for FUNCTION which will then trigger a compiler warning containing
496 the text of "literal string" anywhere that function is called, if
497 supported by the compiler. If the compiler does not support this
498 feature, the macro expands to an unused extern declaration.
500 _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
501 attribute used in _GL_WARN_ON_USE. If the compiler does not support
502 this feature, it expands to empty.
504 These macros are useful for marking a function as a potential
505 portability trap, with the intent that "literal string" include
506 instructions on the replacement function that should be used
507 instead.
508 _GL_WARN_ON_USE is for functions with 'extern' linkage.
509 _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
510 linkage.
512 However, one of the reasons that a function is a portability trap is
513 if it has the wrong signature. Declaring FUNCTION with a different
514 signature in C is a compilation error, so this macro must use the
515 same type as any existing declaration so that programs that avoid
516 the problematic FUNCTION do not fail to compile merely because they
517 included a header that poisoned the function. But this implies that
518 _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
519 have a declaration. Use of this macro implies that there must not
520 be any other macro hiding the declaration of FUNCTION; but
521 undefining FUNCTION first is part of the poisoning process anyway
522 (although for symbols that are provided only via a macro, the result
523 is a compilation error rather than a warning containing
524 "literal string"). Also note that in C++, it is only safe to use if
525 FUNCTION has no overloads.
527 For an example, it is possible to poison 'getline' by:
528 - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
529 [getline]) in configure.ac, which potentially defines
530 HAVE_RAW_DECL_GETLINE
531 - adding this code to a header that wraps the system <stdio.h>:
532 #undef getline
533 #if HAVE_RAW_DECL_GETLINE
534 _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
535 "not universally present; use the gnulib module getline");
536 #endif
538 It is not possible to directly poison global variables. But it is
539 possible to write a wrapper accessor function, and poison that
540 (less common usage, like &environ, will cause a compilation error
541 rather than issue the nice warning, but the end result of informing
542 the developer about their portability problem is still achieved):
543 #if HAVE_RAW_DECL_ENVIRON
544 static char ***
545 rpl_environ (void) { return &environ; }
546 _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
547 # undef environ
548 # define environ (*rpl_environ ())
549 #endif
550 or better (avoiding contradictory use of 'static' and 'extern'):
551 #if HAVE_RAW_DECL_ENVIRON
552 static char ***
553 _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
554 rpl_environ (void) { return &environ; }
555 # undef environ
556 # define environ (*rpl_environ ())
557 #endif
559 #ifndef _GL_WARN_ON_USE
561 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
562 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
563 # define _GL_WARN_ON_USE(function, message) \
564 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
565 # define _GL_WARN_ON_USE_ATTRIBUTE(message) \
566 __attribute__ ((__warning__ (message)))
567 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
568 /* Verify the existence of the function. */
569 # define _GL_WARN_ON_USE(function, message) \
570 extern __typeof__ (function) function
571 # define _GL_WARN_ON_USE_ATTRIBUTE(message)
572 # else /* Unsupported. */
573 # define _GL_WARN_ON_USE(function, message) \
574 _GL_WARN_EXTERN_C int _gl_warn_on_use
575 # define _GL_WARN_ON_USE_ATTRIBUTE(message)
576 # endif
577 #endif
579 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
580 is like _GL_WARN_ON_USE (function, "string"), except that the function is
581 declared with the given prototype, consisting of return type, parameters,
582 and attributes.
583 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
584 not work in this case. */
585 #ifndef _GL_WARN_ON_USE_CXX
586 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
587 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
588 extern rettype function parameters_and_attributes \
589 __attribute__ ((__warning__ (msg)))
590 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
591 /* Verify the existence of the function. */
592 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
593 extern rettype function parameters_and_attributes
594 # else /* Unsupported. */
595 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
596 _GL_WARN_EXTERN_C int _gl_warn_on_use
597 # endif
598 #endif
600 /* _GL_WARN_EXTERN_C declaration;
601 performs the declaration with C linkage. */
602 #ifndef _GL_WARN_EXTERN_C
603 # if defined __cplusplus
604 # define _GL_WARN_EXTERN_C extern "C"
605 # else
606 # define _GL_WARN_EXTERN_C extern
607 # endif
608 #endif
611 /* Get getopt(), optarg, optind, opterr, optopt. */
612 #if 0 && !defined _GL_SYSTEM_GETOPT
613 # include <getopt-cdefs.h>
614 # include <getopt-pfx-core.h>
615 #endif
617 #ifndef _GL_INLINE_HEADER_BEGIN
618 #error "Please include config.h first."
619 #endif
620 _GL_INLINE_HEADER_BEGIN
621 #ifndef _GL_UNISTD_INLINE
622 # define _GL_UNISTD_INLINE _GL_INLINE
623 #endif
625 /* Hide some function declarations from <winsock2.h>. */
627 #if 0 && 0
628 # if !defined _GL_SYS_SOCKET_H
629 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
630 # undef socket
631 # define socket socket_used_without_including_sys_socket_h
632 # undef connect
633 # define connect connect_used_without_including_sys_socket_h
634 # undef accept
635 # define accept accept_used_without_including_sys_socket_h
636 # undef bind
637 # define bind bind_used_without_including_sys_socket_h
638 # undef getpeername
639 # define getpeername getpeername_used_without_including_sys_socket_h
640 # undef getsockname
641 # define getsockname getsockname_used_without_including_sys_socket_h
642 # undef getsockopt
643 # define getsockopt getsockopt_used_without_including_sys_socket_h
644 # undef listen
645 # define listen listen_used_without_including_sys_socket_h
646 # undef recv
647 # define recv recv_used_without_including_sys_socket_h
648 # undef send
649 # define send send_used_without_including_sys_socket_h
650 # undef recvfrom
651 # define recvfrom recvfrom_used_without_including_sys_socket_h
652 # undef sendto
653 # define sendto sendto_used_without_including_sys_socket_h
654 # undef setsockopt
655 # define setsockopt setsockopt_used_without_including_sys_socket_h
656 # undef shutdown
657 # define shutdown shutdown_used_without_including_sys_socket_h
658 # else
659 _GL_WARN_ON_USE (socket,
660 "socket() used without including <sys/socket.h>");
661 _GL_WARN_ON_USE (connect,
662 "connect() used without including <sys/socket.h>");
663 _GL_WARN_ON_USE (accept,
664 "accept() used without including <sys/socket.h>");
665 _GL_WARN_ON_USE (bind,
666 "bind() used without including <sys/socket.h>");
667 _GL_WARN_ON_USE (getpeername,
668 "getpeername() used without including <sys/socket.h>");
669 _GL_WARN_ON_USE (getsockname,
670 "getsockname() used without including <sys/socket.h>");
671 _GL_WARN_ON_USE (getsockopt,
672 "getsockopt() used without including <sys/socket.h>");
673 _GL_WARN_ON_USE (listen,
674 "listen() used without including <sys/socket.h>");
675 _GL_WARN_ON_USE (recv,
676 "recv() used without including <sys/socket.h>");
677 _GL_WARN_ON_USE (send,
678 "send() used without including <sys/socket.h>");
679 _GL_WARN_ON_USE (recvfrom,
680 "recvfrom() used without including <sys/socket.h>");
681 _GL_WARN_ON_USE (sendto,
682 "sendto() used without including <sys/socket.h>");
683 _GL_WARN_ON_USE (setsockopt,
684 "setsockopt() used without including <sys/socket.h>");
685 _GL_WARN_ON_USE (shutdown,
686 "shutdown() used without including <sys/socket.h>");
687 # endif
688 # endif
689 # if !defined _GL_SYS_SELECT_H
690 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
691 # undef select
692 # define select select_used_without_including_sys_select_h
693 # else
694 _GL_WARN_ON_USE (select,
695 "select() used without including <sys/select.h>");
696 # endif
697 # endif
698 #endif
701 /* OS/2 EMX lacks these macros. */
702 #ifndef STDIN_FILENO
703 # define STDIN_FILENO 0
704 #endif
705 #ifndef STDOUT_FILENO
706 # define STDOUT_FILENO 1
707 #endif
708 #ifndef STDERR_FILENO
709 # define STDERR_FILENO 2
710 #endif
712 /* Ensure *_OK macros exist. */
713 #ifndef F_OK
714 # define F_OK 0
715 # define X_OK 1
716 # define W_OK 2
717 # define R_OK 4
718 #endif
721 /* Declare overridden functions. */
724 #if defined GNULIB_POSIXCHECK
725 /* The access() function is a security risk. */
726 _GL_WARN_ON_USE (access, "the access function is a security risk - "
727 "use the gnulib module faccessat instead");
728 #endif
731 #if 1
732 _GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
733 _GL_CXXALIASWARN (chdir);
734 #elif defined GNULIB_POSIXCHECK
735 # undef chdir
736 # if HAVE_RAW_DECL_CHDIR
737 _GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
738 "use gnulib module chdir for portability");
739 # endif
740 #endif
743 #if 0
744 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
745 to GID (if GID is not -1). Follow symbolic links.
746 Return 0 if successful, otherwise -1 and errno set.
747 See the POSIX:2008 specification
748 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */
749 # if 0
750 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
751 # undef chown
752 # define chown rpl_chown
753 # endif
754 _GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
755 _GL_ARG_NONNULL ((1)));
756 _GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
757 # else
758 # if !1
759 _GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
760 _GL_ARG_NONNULL ((1)));
761 # endif
762 _GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
763 # endif
764 _GL_CXXALIASWARN (chown);
765 #elif defined GNULIB_POSIXCHECK
766 # undef chown
767 # if HAVE_RAW_DECL_CHOWN
768 _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
769 "doesn't treat a uid or gid of -1 on some systems - "
770 "use gnulib module chown for portability");
771 # endif
772 #endif
775 #if 1
776 # if 0
777 /* Automatically included by modules that need a replacement for close. */
778 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
779 # undef close
780 # define close rpl_close
781 # endif
782 _GL_FUNCDECL_RPL (close, int, (int fd));
783 _GL_CXXALIAS_RPL (close, int, (int fd));
784 # else
785 _GL_CXXALIAS_SYS (close, int, (int fd));
786 # endif
787 _GL_CXXALIASWARN (close);
788 #elif 0
789 # undef close
790 # define close close_used_without_requesting_gnulib_module_close
791 #elif defined GNULIB_POSIXCHECK
792 # undef close
793 /* Assume close is always declared. */
794 _GL_WARN_ON_USE (close, "close does not portably work on sockets - "
795 "use gnulib module close for portability");
796 #endif
799 #if 0
800 # if 0
801 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
802 # define dup rpl_dup
803 # endif
804 _GL_FUNCDECL_RPL (dup, int, (int oldfd));
805 _GL_CXXALIAS_RPL (dup, int, (int oldfd));
806 # else
807 _GL_CXXALIAS_SYS (dup, int, (int oldfd));
808 # endif
809 _GL_CXXALIASWARN (dup);
810 #elif defined GNULIB_POSIXCHECK
811 # undef dup
812 # if HAVE_RAW_DECL_DUP
813 _GL_WARN_ON_USE (dup, "dup is unportable - "
814 "use gnulib module dup for portability");
815 # endif
816 #endif
819 #if 1
820 /* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
821 NEWFD = OLDFD, otherwise close NEWFD first if it is open.
822 Return newfd if successful, otherwise -1 and errno set.
823 See the POSIX:2008 specification
824 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */
825 # if 0
826 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
827 # define dup2 rpl_dup2
828 # endif
829 _GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
830 _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
831 # else
832 # if !1
833 _GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd));
834 # endif
835 _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
836 # endif
837 _GL_CXXALIASWARN (dup2);
838 #elif defined GNULIB_POSIXCHECK
839 # undef dup2
840 # if HAVE_RAW_DECL_DUP2
841 _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
842 "use gnulib module dup2 for portability");
843 # endif
844 #endif
847 #if 0
848 /* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
849 specified flags.
850 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
851 and O_TEXT, O_BINARY (defined in "binary-io.h").
852 Close NEWFD first if it is open.
853 Return newfd if successful, otherwise -1 and errno set.
854 See the Linux man page at
855 <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
856 # if 1
857 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
858 # define dup3 rpl_dup3
859 # endif
860 _GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
861 _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
862 # else
863 _GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
864 _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
865 # endif
866 _GL_CXXALIASWARN (dup3);
867 #elif defined GNULIB_POSIXCHECK
868 # undef dup3
869 # if HAVE_RAW_DECL_DUP3
870 _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
871 "use gnulib module dup3 for portability");
872 # endif
873 #endif
876 #if 1
877 # if defined __CYGWIN__ && !defined __i386__
878 /* The 'environ' variable is defined in a DLL. Therefore its declaration needs
879 the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it.
880 This leads to a link error on 64-bit Cygwin when the option
881 -Wl,--disable-auto-import is in use. */
882 _GL_EXTERN_C __declspec(dllimport) char **environ;
883 # endif
884 # if !1
885 /* Set of environment variables and values. An array of strings of the form
886 "VARIABLE=VALUE", terminated with a NULL. */
887 # if defined __APPLE__ && defined __MACH__
888 # include <TargetConditionals.h>
889 # if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
890 # define _GL_USE_CRT_EXTERNS
891 # endif
892 # endif
893 # ifdef _GL_USE_CRT_EXTERNS
894 # include <crt_externs.h>
895 # define environ (*_NSGetEnviron ())
896 # else
897 # ifdef __cplusplus
898 extern "C" {
899 # endif
900 extern char **environ;
901 # ifdef __cplusplus
903 # endif
904 # endif
905 # endif
906 #elif defined GNULIB_POSIXCHECK
907 # if HAVE_RAW_DECL_ENVIRON
908 _GL_UNISTD_INLINE char ***
909 _GL_WARN_ON_USE_ATTRIBUTE ("environ is unportable - "
910 "use gnulib module environ for portability")
911 rpl_environ (void)
913 return &environ;
915 # undef environ
916 # define environ (*rpl_environ ())
917 # endif
918 #endif
921 #if 1
922 /* Like access(), except that it uses the effective user id and group id of
923 the current process. */
924 # if !1
925 _GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
926 _GL_ARG_NONNULL ((1)));
927 # endif
928 _GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
929 _GL_CXXALIASWARN (euidaccess);
930 # if defined GNULIB_POSIXCHECK
931 /* Like access(), this function is a security risk. */
932 _GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
933 "use the gnulib module faccessat instead");
934 # endif
935 #elif defined GNULIB_POSIXCHECK
936 # undef euidaccess
937 # if HAVE_RAW_DECL_EUIDACCESS
938 _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
939 "use gnulib module euidaccess for portability");
940 # endif
941 #endif
944 #if 0
945 # if 0
946 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
947 # undef faccessat
948 # define faccessat rpl_faccessat
949 # endif
950 _GL_FUNCDECL_RPL (faccessat, int,
951 (int fd, char const *name, int mode, int flag)
952 _GL_ARG_NONNULL ((2)));
953 _GL_CXXALIAS_RPL (faccessat, int,
954 (int fd, char const *name, int mode, int flag));
955 # else
956 # if !1
957 _GL_FUNCDECL_SYS (faccessat, int,
958 (int fd, char const *file, int mode, int flag)
959 _GL_ARG_NONNULL ((2)));
960 # endif
961 _GL_CXXALIAS_SYS (faccessat, int,
962 (int fd, char const *file, int mode, int flag));
963 # endif
964 _GL_CXXALIASWARN (faccessat);
965 #elif defined GNULIB_POSIXCHECK
966 # undef faccessat
967 # if HAVE_RAW_DECL_FACCESSAT
968 _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
969 "use gnulib module faccessat for portability");
970 # endif
971 #endif
974 #if 0
975 /* Change the process' current working directory to the directory on which
976 the given file descriptor is open.
977 Return 0 if successful, otherwise -1 and errno set.
978 See the POSIX:2008 specification
979 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */
980 # if ! 1
981 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
983 /* Gnulib internal hooks needed to maintain the fchdir metadata. */
984 _GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
985 _GL_ARG_NONNULL ((2));
986 _GL_EXTERN_C void _gl_unregister_fd (int fd);
987 _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
988 _GL_EXTERN_C const char *_gl_directory_name (int fd);
990 # else
991 # if !1
992 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
993 # endif
994 # endif
995 _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
996 _GL_CXXALIASWARN (fchdir);
997 #elif defined GNULIB_POSIXCHECK
998 # undef fchdir
999 # if HAVE_RAW_DECL_FCHDIR
1000 _GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
1001 "use gnulib module fchdir for portability");
1002 # endif
1003 #endif
1006 #if 0
1007 # if 0
1008 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1009 # undef fchownat
1010 # define fchownat rpl_fchownat
1011 # endif
1012 _GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
1013 uid_t owner, gid_t group, int flag)
1014 _GL_ARG_NONNULL ((2)));
1015 _GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
1016 uid_t owner, gid_t group, int flag));
1017 # else
1018 # if !1
1019 _GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
1020 uid_t owner, gid_t group, int flag)
1021 _GL_ARG_NONNULL ((2)));
1022 # endif
1023 _GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
1024 uid_t owner, gid_t group, int flag));
1025 # endif
1026 _GL_CXXALIASWARN (fchownat);
1027 #elif defined GNULIB_POSIXCHECK
1028 # undef fchownat
1029 # if HAVE_RAW_DECL_FCHOWNAT
1030 _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
1031 "use gnulib module openat for portability");
1032 # endif
1033 #endif
1036 #if 0
1037 /* Synchronize changes to a file.
1038 Return 0 if successful, otherwise -1 and errno set.
1039 See POSIX:2008 specification
1040 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */
1041 # if !1 || !1
1042 _GL_FUNCDECL_SYS (fdatasync, int, (int fd));
1043 # endif
1044 _GL_CXXALIAS_SYS (fdatasync, int, (int fd));
1045 _GL_CXXALIASWARN (fdatasync);
1046 #elif defined GNULIB_POSIXCHECK
1047 # undef fdatasync
1048 # if HAVE_RAW_DECL_FDATASYNC
1049 _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
1050 "use gnulib module fdatasync for portability");
1051 # endif
1052 #endif
1055 #if 0
1056 /* Synchronize changes, including metadata, to a file.
1057 Return 0 if successful, otherwise -1 and errno set.
1058 See POSIX:2008 specification
1059 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */
1060 # if !1
1061 _GL_FUNCDECL_SYS (fsync, int, (int fd));
1062 # endif
1063 _GL_CXXALIAS_SYS (fsync, int, (int fd));
1064 _GL_CXXALIASWARN (fsync);
1065 #elif defined GNULIB_POSIXCHECK
1066 # undef fsync
1067 # if HAVE_RAW_DECL_FSYNC
1068 _GL_WARN_ON_USE (fsync, "fsync is unportable - "
1069 "use gnulib module fsync for portability");
1070 # endif
1071 #endif
1074 #if 0
1075 /* Change the size of the file to which FD is opened to become equal to LENGTH.
1076 Return 0 if successful, otherwise -1 and errno set.
1077 See the POSIX:2008 specification
1078 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */
1079 # if 0
1080 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1081 # undef ftruncate
1082 # define ftruncate rpl_ftruncate
1083 # endif
1084 _GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
1085 _GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
1086 # else
1087 # if !1
1088 _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
1089 # endif
1090 _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
1091 # endif
1092 _GL_CXXALIASWARN (ftruncate);
1093 #elif defined GNULIB_POSIXCHECK
1094 # undef ftruncate
1095 # if HAVE_RAW_DECL_FTRUNCATE
1096 _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
1097 "use gnulib module ftruncate for portability");
1098 # endif
1099 #endif
1102 #if 0
1103 /* Get the name of the current working directory, and put it in SIZE bytes
1104 of BUF.
1105 Return BUF if successful, or NULL if the directory couldn't be determined
1106 or SIZE was too small.
1107 See the POSIX:2008 specification
1108 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
1109 Additionally, the gnulib module 'getcwd' guarantees the following GNU
1110 extension: If BUF is NULL, an array is allocated with 'malloc'; the array
1111 is SIZE bytes long, unless SIZE == 0, in which case it is as big as
1112 necessary. */
1113 # if 0
1114 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1115 # define getcwd rpl_getcwd
1116 # endif
1117 _GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
1118 _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
1119 # else
1120 /* Need to cast, because on mingw, the second parameter is
1121 int size. */
1122 _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
1123 # endif
1124 _GL_CXXALIASWARN (getcwd);
1125 #elif defined GNULIB_POSIXCHECK
1126 # undef getcwd
1127 # if HAVE_RAW_DECL_GETCWD
1128 _GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
1129 "use gnulib module getcwd for portability");
1130 # endif
1131 #endif
1134 #if 0
1135 /* Return the NIS domain name of the machine.
1136 WARNING! The NIS domain name is unrelated to the fully qualified host name
1137 of the machine. It is also unrelated to email addresses.
1138 WARNING! The NIS domain name is usually the empty string or "(none)" when
1139 not using NIS.
1141 Put up to LEN bytes of the NIS domain name into NAME.
1142 Null terminate it if the name is shorter than LEN.
1143 If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
1144 Return 0 if successful, otherwise set errno and return -1. */
1145 # if 0
1146 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1147 # undef getdomainname
1148 # define getdomainname rpl_getdomainname
1149 # endif
1150 _GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
1151 _GL_ARG_NONNULL ((1)));
1152 _GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
1153 # else
1154 # if !1
1155 _GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
1156 _GL_ARG_NONNULL ((1)));
1157 # endif
1158 _GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
1159 # endif
1160 _GL_CXXALIASWARN (getdomainname);
1161 #elif defined GNULIB_POSIXCHECK
1162 # undef getdomainname
1163 # if HAVE_RAW_DECL_GETDOMAINNAME
1164 _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
1165 "use gnulib module getdomainname for portability");
1166 # endif
1167 #endif
1170 #if 1
1171 /* Return the maximum number of file descriptors in the current process.
1172 In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
1173 # if 0
1174 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1175 # undef getdtablesize
1176 # define getdtablesize rpl_getdtablesize
1177 # endif
1178 _GL_FUNCDECL_RPL (getdtablesize, int, (void));
1179 _GL_CXXALIAS_RPL (getdtablesize, int, (void));
1180 # else
1181 # if !1
1182 _GL_FUNCDECL_SYS (getdtablesize, int, (void));
1183 # endif
1184 _GL_CXXALIAS_SYS (getdtablesize, int, (void));
1185 # endif
1186 _GL_CXXALIASWARN (getdtablesize);
1187 #elif defined GNULIB_POSIXCHECK
1188 # undef getdtablesize
1189 # if HAVE_RAW_DECL_GETDTABLESIZE
1190 _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
1191 "use gnulib module getdtablesize for portability");
1192 # endif
1193 #endif
1196 #if 1
1197 /* Return the supplemental groups that the current process belongs to.
1198 It is unspecified whether the effective group id is in the list.
1199 If N is 0, return the group count; otherwise, N describes how many
1200 entries are available in GROUPS. Return -1 and set errno if N is
1201 not 0 and not large enough. Fails with ENOSYS on some systems. */
1202 # if 0
1203 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1204 # undef getgroups
1205 # define getgroups rpl_getgroups
1206 # endif
1207 _GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
1208 _GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
1209 # else
1210 # if !1
1211 _GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
1212 # endif
1213 _GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
1214 # endif
1215 _GL_CXXALIASWARN (getgroups);
1216 #elif defined GNULIB_POSIXCHECK
1217 # undef getgroups
1218 # if HAVE_RAW_DECL_GETGROUPS
1219 _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
1220 "use gnulib module getgroups for portability");
1221 # endif
1222 #endif
1225 #if 0
1226 /* Return the standard host name of the machine.
1227 WARNING! The host name may or may not be fully qualified.
1229 Put up to LEN bytes of the host name into NAME.
1230 Null terminate it if the name is shorter than LEN.
1231 If the host name is longer than LEN, set errno = EINVAL and return -1.
1232 Return 0 if successful, otherwise set errno and return -1. */
1233 # if 0
1234 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1235 # undef gethostname
1236 # define gethostname rpl_gethostname
1237 # endif
1238 _GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
1239 _GL_ARG_NONNULL ((1)));
1240 _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
1241 # else
1242 # if !1
1243 _GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
1244 _GL_ARG_NONNULL ((1)));
1245 # endif
1246 /* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
1247 parameter is
1248 int len. */
1249 _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
1250 # endif
1251 _GL_CXXALIASWARN (gethostname);
1252 #elif 0
1253 # undef gethostname
1254 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
1255 #elif defined GNULIB_POSIXCHECK
1256 # undef gethostname
1257 # if HAVE_RAW_DECL_GETHOSTNAME
1258 _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
1259 "use gnulib module gethostname for portability");
1260 # endif
1261 #endif
1264 #if 0
1265 /* Returns the user's login name, or NULL if it cannot be found. Upon error,
1266 returns NULL with errno set.
1268 See <http://www.opengroup.org/susv3xsh/getlogin.html>.
1270 Most programs don't need to use this function, because the information is
1271 available through environment variables:
1272 ${LOGNAME-$USER} on Unix platforms,
1273 $USERNAME on native Windows platforms.
1275 # if !1
1276 _GL_FUNCDECL_SYS (getlogin, char *, (void));
1277 # endif
1278 _GL_CXXALIAS_SYS (getlogin, char *, (void));
1279 _GL_CXXALIASWARN (getlogin);
1280 #elif defined GNULIB_POSIXCHECK
1281 # undef getlogin
1282 # if HAVE_RAW_DECL_GETLOGIN
1283 _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
1284 "use gnulib module getlogin for portability");
1285 # endif
1286 #endif
1289 #if 0
1290 /* Copies the user's login name to NAME.
1291 The array pointed to by NAME has room for SIZE bytes.
1293 Returns 0 if successful. Upon error, an error number is returned, or -1 in
1294 the case that the login name cannot be found but no specific error is
1295 provided (this case is hopefully rare but is left open by the POSIX spec).
1297 See <http://www.opengroup.org/susv3xsh/getlogin.html>.
1299 Most programs don't need to use this function, because the information is
1300 available through environment variables:
1301 ${LOGNAME-$USER} on Unix platforms,
1302 $USERNAME on native Windows platforms.
1304 # if 0
1305 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1306 # define getlogin_r rpl_getlogin_r
1307 # endif
1308 _GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
1309 _GL_ARG_NONNULL ((1)));
1310 _GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
1311 # else
1312 # if !1
1313 _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
1314 _GL_ARG_NONNULL ((1)));
1315 # endif
1316 /* Need to cast, because on Solaris 10 systems, the second argument is
1317 int size. */
1318 _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
1319 # endif
1320 _GL_CXXALIASWARN (getlogin_r);
1321 #elif defined GNULIB_POSIXCHECK
1322 # undef getlogin_r
1323 # if HAVE_RAW_DECL_GETLOGIN_R
1324 _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
1325 "use gnulib module getlogin_r for portability");
1326 # endif
1327 #endif
1330 #if 0
1331 # if 0
1332 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1333 # define getpagesize rpl_getpagesize
1334 # endif
1335 _GL_FUNCDECL_RPL (getpagesize, int, (void));
1336 _GL_CXXALIAS_RPL (getpagesize, int, (void));
1337 # else
1338 # if !1
1339 # if !defined getpagesize
1340 /* This is for POSIX systems. */
1341 # if !defined _gl_getpagesize && defined _SC_PAGESIZE
1342 # if ! (defined __VMS && __VMS_VER < 70000000)
1343 # define _gl_getpagesize() sysconf (_SC_PAGESIZE)
1344 # endif
1345 # endif
1346 /* This is for older VMS. */
1347 # if !defined _gl_getpagesize && defined __VMS
1348 # ifdef __ALPHA
1349 # define _gl_getpagesize() 8192
1350 # else
1351 # define _gl_getpagesize() 512
1352 # endif
1353 # endif
1354 /* This is for BeOS. */
1355 # if !defined _gl_getpagesize && 0
1356 # include <OS.h>
1357 # if defined B_PAGE_SIZE
1358 # define _gl_getpagesize() B_PAGE_SIZE
1359 # endif
1360 # endif
1361 /* This is for AmigaOS4.0. */
1362 # if !defined _gl_getpagesize && defined __amigaos4__
1363 # define _gl_getpagesize() 2048
1364 # endif
1365 /* This is for older Unix systems. */
1366 # if !defined _gl_getpagesize && 0
1367 # include <sys/param.h>
1368 # ifdef EXEC_PAGESIZE
1369 # define _gl_getpagesize() EXEC_PAGESIZE
1370 # else
1371 # ifdef NBPG
1372 # ifndef CLSIZE
1373 # define CLSIZE 1
1374 # endif
1375 # define _gl_getpagesize() (NBPG * CLSIZE)
1376 # else
1377 # ifdef NBPC
1378 # define _gl_getpagesize() NBPC
1379 # endif
1380 # endif
1381 # endif
1382 # endif
1383 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1384 # define getpagesize() _gl_getpagesize ()
1385 # else
1386 # if !GNULIB_defined_getpagesize_function
1387 _GL_UNISTD_INLINE int
1388 getpagesize ()
1390 return _gl_getpagesize ();
1392 # define GNULIB_defined_getpagesize_function 1
1393 # endif
1394 # endif
1395 # endif
1396 # endif
1397 /* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t. */
1398 _GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
1399 # endif
1400 # if 1
1401 _GL_CXXALIASWARN (getpagesize);
1402 # endif
1403 #elif defined GNULIB_POSIXCHECK
1404 # undef getpagesize
1405 # if HAVE_RAW_DECL_GETPAGESIZE
1406 _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
1407 "use gnulib module getpagesize for portability");
1408 # endif
1409 #endif
1412 #if 1
1413 /* Function getpass() from module 'getpass':
1414 Read a password from /dev/tty or stdin.
1415 Function getpass() from module 'getpass-gnu':
1416 Read a password of arbitrary length from /dev/tty or stdin. */
1417 # if 0
1418 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1419 # undef getpass
1420 # define getpass rpl_getpass
1421 # endif
1422 _GL_FUNCDECL_RPL (getpass, char *, (const char *prompt)
1423 _GL_ARG_NONNULL ((1)));
1424 _GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
1425 # else
1426 # if !1
1427 _GL_FUNCDECL_SYS (getpass, char *, (const char *prompt)
1428 _GL_ARG_NONNULL ((1)));
1429 # endif
1430 _GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
1431 # endif
1432 _GL_CXXALIASWARN (getpass);
1433 #elif defined GNULIB_POSIXCHECK
1434 # undef getpass
1435 # if HAVE_RAW_DECL_GETPASS
1436 _GL_WARN_ON_USE (getpass, "getpass is unportable - "
1437 "use gnulib module getpass or getpass-gnu for portability");
1438 # endif
1439 #endif
1442 #if 0
1443 /* Return the next valid login shell on the system, or NULL when the end of
1444 the list has been reached. */
1445 # if !1
1446 _GL_FUNCDECL_SYS (getusershell, char *, (void));
1447 # endif
1448 _GL_CXXALIAS_SYS (getusershell, char *, (void));
1449 _GL_CXXALIASWARN (getusershell);
1450 #elif defined GNULIB_POSIXCHECK
1451 # undef getusershell
1452 # if HAVE_RAW_DECL_GETUSERSHELL
1453 _GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
1454 "use gnulib module getusershell for portability");
1455 # endif
1456 #endif
1458 #if 0
1459 /* Rewind to pointer that is advanced at each getusershell() call. */
1460 # if !1
1461 _GL_FUNCDECL_SYS (setusershell, void, (void));
1462 # endif
1463 _GL_CXXALIAS_SYS (setusershell, void, (void));
1464 _GL_CXXALIASWARN (setusershell);
1465 #elif defined GNULIB_POSIXCHECK
1466 # undef setusershell
1467 # if HAVE_RAW_DECL_SETUSERSHELL
1468 _GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
1469 "use gnulib module getusershell for portability");
1470 # endif
1471 #endif
1473 #if 0
1474 /* Free the pointer that is advanced at each getusershell() call and
1475 associated resources. */
1476 # if !1
1477 _GL_FUNCDECL_SYS (endusershell, void, (void));
1478 # endif
1479 _GL_CXXALIAS_SYS (endusershell, void, (void));
1480 _GL_CXXALIASWARN (endusershell);
1481 #elif defined GNULIB_POSIXCHECK
1482 # undef endusershell
1483 # if HAVE_RAW_DECL_ENDUSERSHELL
1484 _GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
1485 "use gnulib module getusershell for portability");
1486 # endif
1487 #endif
1490 #if 1
1491 /* Determine whether group id is in calling user's group list. */
1492 # if !1
1493 _GL_FUNCDECL_SYS (group_member, int, (gid_t gid));
1494 # endif
1495 _GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
1496 _GL_CXXALIASWARN (group_member);
1497 #elif defined GNULIB_POSIXCHECK
1498 # undef group_member
1499 # if HAVE_RAW_DECL_GROUP_MEMBER
1500 _GL_WARN_ON_USE (group_member, "group_member is unportable - "
1501 "use gnulib module group-member for portability");
1502 # endif
1503 #endif
1506 #if 0
1507 # if 0
1508 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1509 # undef isatty
1510 # define isatty rpl_isatty
1511 # endif
1512 _GL_FUNCDECL_RPL (isatty, int, (int fd));
1513 _GL_CXXALIAS_RPL (isatty, int, (int fd));
1514 # else
1515 _GL_CXXALIAS_SYS (isatty, int, (int fd));
1516 # endif
1517 _GL_CXXALIASWARN (isatty);
1518 #elif defined GNULIB_POSIXCHECK
1519 # undef isatty
1520 # if HAVE_RAW_DECL_ISATTY
1521 _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
1522 "use gnulib module isatty for portability");
1523 # endif
1524 #endif
1527 #if 0
1528 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
1529 to GID (if GID is not -1). Do not follow symbolic links.
1530 Return 0 if successful, otherwise -1 and errno set.
1531 See the POSIX:2008 specification
1532 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */
1533 # if 0
1534 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1535 # undef lchown
1536 # define lchown rpl_lchown
1537 # endif
1538 _GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
1539 _GL_ARG_NONNULL ((1)));
1540 _GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
1541 # else
1542 # if !1
1543 _GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
1544 _GL_ARG_NONNULL ((1)));
1545 # endif
1546 _GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
1547 # endif
1548 _GL_CXXALIASWARN (lchown);
1549 #elif defined GNULIB_POSIXCHECK
1550 # undef lchown
1551 # if HAVE_RAW_DECL_LCHOWN
1552 _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
1553 "use gnulib module lchown for portability");
1554 # endif
1555 #endif
1558 #if 0
1559 /* Create a new hard link for an existing file.
1560 Return 0 if successful, otherwise -1 and errno set.
1561 See POSIX:2008 specification
1562 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */
1563 # if 0
1564 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1565 # define link rpl_link
1566 # endif
1567 _GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
1568 _GL_ARG_NONNULL ((1, 2)));
1569 _GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
1570 # else
1571 # if !1
1572 _GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
1573 _GL_ARG_NONNULL ((1, 2)));
1574 # endif
1575 _GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
1576 # endif
1577 _GL_CXXALIASWARN (link);
1578 #elif defined GNULIB_POSIXCHECK
1579 # undef link
1580 # if HAVE_RAW_DECL_LINK
1581 _GL_WARN_ON_USE (link, "link is unportable - "
1582 "use gnulib module link for portability");
1583 # endif
1584 #endif
1587 #if 0
1588 /* Create a new hard link for an existing file, relative to two
1589 directories. FLAG controls whether symlinks are followed.
1590 Return 0 if successful, otherwise -1 and errno set. */
1591 # if 0
1592 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1593 # undef linkat
1594 # define linkat rpl_linkat
1595 # endif
1596 _GL_FUNCDECL_RPL (linkat, int,
1597 (int fd1, const char *path1, int fd2, const char *path2,
1598 int flag)
1599 _GL_ARG_NONNULL ((2, 4)));
1600 _GL_CXXALIAS_RPL (linkat, int,
1601 (int fd1, const char *path1, int fd2, const char *path2,
1602 int flag));
1603 # else
1604 # if !1
1605 _GL_FUNCDECL_SYS (linkat, int,
1606 (int fd1, const char *path1, int fd2, const char *path2,
1607 int flag)
1608 _GL_ARG_NONNULL ((2, 4)));
1609 # endif
1610 _GL_CXXALIAS_SYS (linkat, int,
1611 (int fd1, const char *path1, int fd2, const char *path2,
1612 int flag));
1613 # endif
1614 _GL_CXXALIASWARN (linkat);
1615 #elif defined GNULIB_POSIXCHECK
1616 # undef linkat
1617 # if HAVE_RAW_DECL_LINKAT
1618 _GL_WARN_ON_USE (linkat, "linkat is unportable - "
1619 "use gnulib module linkat for portability");
1620 # endif
1621 #endif
1624 #if 1
1625 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
1626 Return the new offset if successful, otherwise -1 and errno set.
1627 See the POSIX:2008 specification
1628 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */
1629 # if 0
1630 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1631 # define lseek rpl_lseek
1632 # endif
1633 _GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
1634 _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
1635 # else
1636 _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
1637 # endif
1638 _GL_CXXALIASWARN (lseek);
1639 #elif defined GNULIB_POSIXCHECK
1640 # undef lseek
1641 # if HAVE_RAW_DECL_LSEEK
1642 _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
1643 "systems - use gnulib module lseek for portability");
1644 # endif
1645 #endif
1648 #if 0
1649 /* Create a pipe, defaulting to O_BINARY mode.
1650 Store the read-end as fd[0] and the write-end as fd[1].
1651 Return 0 upon success, or -1 with errno set upon failure. */
1652 # if !1
1653 _GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
1654 # endif
1655 _GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
1656 _GL_CXXALIASWARN (pipe);
1657 #elif defined GNULIB_POSIXCHECK
1658 # undef pipe
1659 # if HAVE_RAW_DECL_PIPE
1660 _GL_WARN_ON_USE (pipe, "pipe is unportable - "
1661 "use gnulib module pipe-posix for portability");
1662 # endif
1663 #endif
1666 #if 0
1667 /* Create a pipe, applying the given flags when opening the read-end of the
1668 pipe and the write-end of the pipe.
1669 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
1670 and O_TEXT, O_BINARY (defined in "binary-io.h").
1671 Store the read-end as fd[0] and the write-end as fd[1].
1672 Return 0 upon success, or -1 with errno set upon failure.
1673 See also the Linux man page at
1674 <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
1675 # if 1
1676 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1677 # define pipe2 rpl_pipe2
1678 # endif
1679 _GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
1680 _GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
1681 # else
1682 _GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
1683 _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
1684 # endif
1685 _GL_CXXALIASWARN (pipe2);
1686 #elif defined GNULIB_POSIXCHECK
1687 # undef pipe2
1688 # if HAVE_RAW_DECL_PIPE2
1689 _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
1690 "use gnulib module pipe2 for portability");
1691 # endif
1692 #endif
1695 #if 0
1696 /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
1697 Return the number of bytes placed into BUF if successful, otherwise
1698 set errno and return -1. 0 indicates EOF.
1699 See the POSIX:2008 specification
1700 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */
1701 # if 0
1702 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1703 # undef pread
1704 # define pread rpl_pread
1705 # endif
1706 _GL_FUNCDECL_RPL (pread, ssize_t,
1707 (int fd, void *buf, size_t bufsize, off_t offset)
1708 _GL_ARG_NONNULL ((2)));
1709 _GL_CXXALIAS_RPL (pread, ssize_t,
1710 (int fd, void *buf, size_t bufsize, off_t offset));
1711 # else
1712 # if !1
1713 _GL_FUNCDECL_SYS (pread, ssize_t,
1714 (int fd, void *buf, size_t bufsize, off_t offset)
1715 _GL_ARG_NONNULL ((2)));
1716 # endif
1717 _GL_CXXALIAS_SYS (pread, ssize_t,
1718 (int fd, void *buf, size_t bufsize, off_t offset));
1719 # endif
1720 _GL_CXXALIASWARN (pread);
1721 #elif defined GNULIB_POSIXCHECK
1722 # undef pread
1723 # if HAVE_RAW_DECL_PREAD
1724 _GL_WARN_ON_USE (pread, "pread is unportable - "
1725 "use gnulib module pread for portability");
1726 # endif
1727 #endif
1730 #if 0
1731 /* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
1732 Return the number of bytes written if successful, otherwise
1733 set errno and return -1. 0 indicates nothing written. See the
1734 POSIX:2008 specification
1735 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */
1736 # if 0
1737 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1738 # undef pwrite
1739 # define pwrite rpl_pwrite
1740 # endif
1741 _GL_FUNCDECL_RPL (pwrite, ssize_t,
1742 (int fd, const void *buf, size_t bufsize, off_t offset)
1743 _GL_ARG_NONNULL ((2)));
1744 _GL_CXXALIAS_RPL (pwrite, ssize_t,
1745 (int fd, const void *buf, size_t bufsize, off_t offset));
1746 # else
1747 # if !1
1748 _GL_FUNCDECL_SYS (pwrite, ssize_t,
1749 (int fd, const void *buf, size_t bufsize, off_t offset)
1750 _GL_ARG_NONNULL ((2)));
1751 # endif
1752 _GL_CXXALIAS_SYS (pwrite, ssize_t,
1753 (int fd, const void *buf, size_t bufsize, off_t offset));
1754 # endif
1755 _GL_CXXALIASWARN (pwrite);
1756 #elif defined GNULIB_POSIXCHECK
1757 # undef pwrite
1758 # if HAVE_RAW_DECL_PWRITE
1759 _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
1760 "use gnulib module pwrite for portability");
1761 # endif
1762 #endif
1765 #if 0
1766 /* Read up to COUNT bytes from file descriptor FD into the buffer starting
1767 at BUF. See the POSIX:2008 specification
1768 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */
1769 # if 0
1770 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1771 # undef read
1772 # define read rpl_read
1773 # endif
1774 _GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
1775 _GL_ARG_NONNULL ((2)));
1776 _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
1777 # else
1778 /* Need to cast, because on mingw, the third parameter is
1779 unsigned int count
1780 and the return type is 'int'. */
1781 _GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count));
1782 # endif
1783 _GL_CXXALIASWARN (read);
1784 #endif
1787 #if 1
1788 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
1789 bytes of it into BUF. Return the number of bytes placed into BUF if
1790 successful, otherwise -1 and errno set.
1791 See the POSIX:2008 specification
1792 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */
1793 # if 0
1794 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1795 # define readlink rpl_readlink
1796 # endif
1797 _GL_FUNCDECL_RPL (readlink, ssize_t,
1798 (const char *file, char *buf, size_t bufsize)
1799 _GL_ARG_NONNULL ((1, 2)));
1800 _GL_CXXALIAS_RPL (readlink, ssize_t,
1801 (const char *file, char *buf, size_t bufsize));
1802 # else
1803 # if !1
1804 _GL_FUNCDECL_SYS (readlink, ssize_t,
1805 (const char *file, char *buf, size_t bufsize)
1806 _GL_ARG_NONNULL ((1, 2)));
1807 # endif
1808 _GL_CXXALIAS_SYS (readlink, ssize_t,
1809 (const char *file, char *buf, size_t bufsize));
1810 # endif
1811 _GL_CXXALIASWARN (readlink);
1812 #elif defined GNULIB_POSIXCHECK
1813 # undef readlink
1814 # if HAVE_RAW_DECL_READLINK
1815 _GL_WARN_ON_USE (readlink, "readlink is unportable - "
1816 "use gnulib module readlink for portability");
1817 # endif
1818 #endif
1821 #if 0
1822 # if 0
1823 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1824 # define readlinkat rpl_readlinkat
1825 # endif
1826 _GL_FUNCDECL_RPL (readlinkat, ssize_t,
1827 (int fd, char const *file, char *buf, size_t len)
1828 _GL_ARG_NONNULL ((2, 3)));
1829 _GL_CXXALIAS_RPL (readlinkat, ssize_t,
1830 (int fd, char const *file, char *buf, size_t len));
1831 # else
1832 # if !1
1833 _GL_FUNCDECL_SYS (readlinkat, ssize_t,
1834 (int fd, char const *file, char *buf, size_t len)
1835 _GL_ARG_NONNULL ((2, 3)));
1836 # endif
1837 _GL_CXXALIAS_SYS (readlinkat, ssize_t,
1838 (int fd, char const *file, char *buf, size_t len));
1839 # endif
1840 _GL_CXXALIASWARN (readlinkat);
1841 #elif defined GNULIB_POSIXCHECK
1842 # undef readlinkat
1843 # if HAVE_RAW_DECL_READLINKAT
1844 _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
1845 "use gnulib module readlinkat for portability");
1846 # endif
1847 #endif
1850 #if 1
1851 /* Remove the directory DIR. */
1852 # if 0
1853 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1854 # define rmdir rpl_rmdir
1855 # endif
1856 _GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
1857 _GL_CXXALIAS_RPL (rmdir, int, (char const *name));
1858 # else
1859 _GL_CXXALIAS_SYS (rmdir, int, (char const *name));
1860 # endif
1861 _GL_CXXALIASWARN (rmdir);
1862 #elif defined GNULIB_POSIXCHECK
1863 # undef rmdir
1864 # if HAVE_RAW_DECL_RMDIR
1865 _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
1866 "use gnulib module rmdir for portability");
1867 # endif
1868 #endif
1871 #if 0
1872 /* Set the host name of the machine.
1873 The host name may or may not be fully qualified.
1875 Put LEN bytes of NAME into the host name.
1876 Return 0 if successful, otherwise, set errno and return -1.
1878 Platforms with no ability to set the hostname return -1 and set
1879 errno = ENOSYS. */
1880 # if !1 || !1
1881 _GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
1882 _GL_ARG_NONNULL ((1)));
1883 # endif
1884 /* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
1885 and FreeBSD 6.4 the second parameter is int. On Solaris 11
1886 2011-10, the first parameter is not const. */
1887 _GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
1888 _GL_CXXALIASWARN (sethostname);
1889 #elif defined GNULIB_POSIXCHECK
1890 # undef sethostname
1891 # if HAVE_RAW_DECL_SETHOSTNAME
1892 _GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
1893 "use gnulib module sethostname for portability");
1894 # endif
1895 #endif
1898 #if 0
1899 /* Pause the execution of the current thread for N seconds.
1900 Returns the number of seconds left to sleep.
1901 See the POSIX:2008 specification
1902 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */
1903 # if 0
1904 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1905 # undef sleep
1906 # define sleep rpl_sleep
1907 # endif
1908 _GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
1909 _GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
1910 # else
1911 # if !1
1912 _GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
1913 # endif
1914 _GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
1915 # endif
1916 _GL_CXXALIASWARN (sleep);
1917 #elif defined GNULIB_POSIXCHECK
1918 # undef sleep
1919 # if HAVE_RAW_DECL_SLEEP
1920 _GL_WARN_ON_USE (sleep, "sleep is unportable - "
1921 "use gnulib module sleep for portability");
1922 # endif
1923 #endif
1926 #if 0
1927 # if 0
1928 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1929 # undef symlink
1930 # define symlink rpl_symlink
1931 # endif
1932 _GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
1933 _GL_ARG_NONNULL ((1, 2)));
1934 _GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
1935 # else
1936 # if !1
1937 _GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
1938 _GL_ARG_NONNULL ((1, 2)));
1939 # endif
1940 _GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
1941 # endif
1942 _GL_CXXALIASWARN (symlink);
1943 #elif defined GNULIB_POSIXCHECK
1944 # undef symlink
1945 # if HAVE_RAW_DECL_SYMLINK
1946 _GL_WARN_ON_USE (symlink, "symlink is not portable - "
1947 "use gnulib module symlink for portability");
1948 # endif
1949 #endif
1952 #if 0
1953 # if 0
1954 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1955 # undef symlinkat
1956 # define symlinkat rpl_symlinkat
1957 # endif
1958 _GL_FUNCDECL_RPL (symlinkat, int,
1959 (char const *contents, int fd, char const *file)
1960 _GL_ARG_NONNULL ((1, 3)));
1961 _GL_CXXALIAS_RPL (symlinkat, int,
1962 (char const *contents, int fd, char const *file));
1963 # else
1964 # if !1
1965 _GL_FUNCDECL_SYS (symlinkat, int,
1966 (char const *contents, int fd, char const *file)
1967 _GL_ARG_NONNULL ((1, 3)));
1968 # endif
1969 _GL_CXXALIAS_SYS (symlinkat, int,
1970 (char const *contents, int fd, char const *file));
1971 # endif
1972 _GL_CXXALIASWARN (symlinkat);
1973 #elif defined GNULIB_POSIXCHECK
1974 # undef symlinkat
1975 # if HAVE_RAW_DECL_SYMLINKAT
1976 _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
1977 "use gnulib module symlinkat for portability");
1978 # endif
1979 #endif
1982 #if 0
1983 /* Change the size of the file designated by FILENAME to become equal to LENGTH.
1984 Return 0 if successful, otherwise -1 and errno set.
1985 See the POSIX:2008 specification
1986 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>. */
1987 # if 0
1988 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1989 # undef truncate
1990 # define truncate rpl_truncate
1991 # endif
1992 _GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
1993 _GL_ARG_NONNULL ((1)));
1994 _GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
1995 # else
1996 # if !1
1997 _GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
1998 _GL_ARG_NONNULL ((1)));
1999 # endif
2000 _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
2001 # endif
2002 _GL_CXXALIASWARN (truncate);
2003 #elif defined GNULIB_POSIXCHECK
2004 # undef truncate
2005 # if HAVE_RAW_DECL_TRUNCATE
2006 _GL_WARN_ON_USE (truncate, "truncate is unportable - "
2007 "use gnulib module truncate for portability");
2008 # endif
2009 #endif
2012 #if 0
2013 /* Store at most BUFLEN characters of the pathname of the terminal FD is
2014 open on in BUF. Return 0 on success, otherwise an error number. */
2015 # if 0
2016 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2017 # undef ttyname_r
2018 # define ttyname_r rpl_ttyname_r
2019 # endif
2020 _GL_FUNCDECL_RPL (ttyname_r, int,
2021 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
2022 _GL_CXXALIAS_RPL (ttyname_r, int,
2023 (int fd, char *buf, size_t buflen));
2024 # else
2025 # if !1
2026 _GL_FUNCDECL_SYS (ttyname_r, int,
2027 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
2028 # endif
2029 _GL_CXXALIAS_SYS (ttyname_r, int,
2030 (int fd, char *buf, size_t buflen));
2031 # endif
2032 _GL_CXXALIASWARN (ttyname_r);
2033 #elif defined GNULIB_POSIXCHECK
2034 # undef ttyname_r
2035 # if HAVE_RAW_DECL_TTYNAME_R
2036 _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
2037 "use gnulib module ttyname_r for portability");
2038 # endif
2039 #endif
2042 #if 0
2043 # if 0
2044 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2045 # undef unlink
2046 # define unlink rpl_unlink
2047 # endif
2048 _GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
2049 _GL_CXXALIAS_RPL (unlink, int, (char const *file));
2050 # else
2051 _GL_CXXALIAS_SYS (unlink, int, (char const *file));
2052 # endif
2053 _GL_CXXALIASWARN (unlink);
2054 #elif defined GNULIB_POSIXCHECK
2055 # undef unlink
2056 # if HAVE_RAW_DECL_UNLINK
2057 _GL_WARN_ON_USE (unlink, "unlink is not portable - "
2058 "use gnulib module unlink for portability");
2059 # endif
2060 #endif
2063 #if 0
2064 # if 0
2065 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2066 # undef unlinkat
2067 # define unlinkat rpl_unlinkat
2068 # endif
2069 _GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
2070 _GL_ARG_NONNULL ((2)));
2071 _GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
2072 # else
2073 # if !1
2074 _GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
2075 _GL_ARG_NONNULL ((2)));
2076 # endif
2077 _GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
2078 # endif
2079 _GL_CXXALIASWARN (unlinkat);
2080 #elif defined GNULIB_POSIXCHECK
2081 # undef unlinkat
2082 # if HAVE_RAW_DECL_UNLINKAT
2083 _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
2084 "use gnulib module openat for portability");
2085 # endif
2086 #endif
2089 #if 0
2090 /* Pause the execution of the current thread for N microseconds.
2091 Returns 0 on completion, or -1 on range error.
2092 See the POSIX:2001 specification
2093 <http://www.opengroup.org/susv3xsh/usleep.html>. */
2094 # if 0
2095 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2096 # undef usleep
2097 # define usleep rpl_usleep
2098 # endif
2099 _GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
2100 _GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
2101 # else
2102 # if !1
2103 _GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
2104 # endif
2105 _GL_CXXALIAS_SYS (usleep, int, (useconds_t n));
2106 # endif
2107 _GL_CXXALIASWARN (usleep);
2108 #elif defined GNULIB_POSIXCHECK
2109 # undef usleep
2110 # if HAVE_RAW_DECL_USLEEP
2111 _GL_WARN_ON_USE (usleep, "usleep is unportable - "
2112 "use gnulib module usleep for portability");
2113 # endif
2114 #endif
2117 #if 0
2118 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
2119 See the POSIX:2008 specification
2120 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */
2121 # if 0
2122 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2123 # undef write
2124 # define write rpl_write
2125 # endif
2126 _GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
2127 _GL_ARG_NONNULL ((2)));
2128 _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
2129 # else
2130 /* Need to cast, because on mingw, the third parameter is
2131 unsigned int count
2132 and the return type is 'int'. */
2133 _GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
2134 # endif
2135 _GL_CXXALIASWARN (write);
2136 #endif
2138 _GL_INLINE_HEADER_END
2140 #endif /* _GL_UNISTD_H */
2141 #endif /* _GL_INCLUDING_UNISTD_H */
2142 #endif /* _GL_UNISTD_H */