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