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