Do the Windows oldnames workaround through the C++ GNULIB_NAMESPACE.
[gnulib.git] / lib / unistd.in.h
blobc9fb36889ae8b4c9c7b394cd14285578dbd3beef
1 /* Substitute for and wrapper around <unistd.h>.
2 Copyright (C) 2003-2020 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, see <https://www.gnu.org/licenses/>. */
17 #ifndef _@GUARD_PREFIX@_UNISTD_H
19 #if __GNUC__ >= 3
20 @PRAGMA_SYSTEM_HEADER@
21 #endif
22 @PRAGMA_COLUMNS@
24 #if @HAVE_UNISTD_H@ && defined _GL_INCLUDING_UNISTD_H
25 /* Special invocation convention:
26 - On Mac OS X 10.3.9 we have a sequence of nested includes
27 <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h>
28 In this situation, the functions are not yet declared, therefore we cannot
29 provide the C++ aliases. */
31 #@INCLUDE_NEXT@ @NEXT_UNISTD_H@
33 #else
34 /* Normal invocation convention. */
36 /* The include_next requires a split double-inclusion guard. */
37 #if @HAVE_UNISTD_H@
38 # define _GL_INCLUDING_UNISTD_H
39 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
40 # undef _GL_INCLUDING_UNISTD_H
41 #endif
43 /* Get all possible declarations of gethostname(). */
44 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
45 && !defined _GL_INCLUDING_WINSOCK2_H
46 # define _GL_INCLUDING_WINSOCK2_H
47 # include <winsock2.h>
48 # undef _GL_INCLUDING_WINSOCK2_H
49 #endif
51 #if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
52 #define _@GUARD_PREFIX@_UNISTD_H
54 /* NetBSD 5.0 mis-defines NULL. Also get size_t. */
55 /* But avoid namespace pollution on glibc systems. */
56 #ifndef __GLIBC__
57 # include <stddef.h>
58 #endif
60 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
61 /* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include
62 it before we #define unlink rpl_unlink. */
63 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */
64 /* But avoid namespace pollution on glibc systems. */
65 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
66 || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
67 && (defined _WIN32 && ! defined __CYGWIN__)) \
68 || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
69 && defined __CYGWIN__)) \
70 && ! defined __GLIBC__
71 # include <stdio.h>
72 #endif
74 /* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in
75 <unistd.h>. */
76 /* But avoid namespace pollution on glibc systems. */
77 #if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \
78 && (defined __CYGWIN__ || defined __ANDROID__) \
79 && ! defined __GLIBC__
80 # include <fcntl.h>
81 #endif
83 /* mingw fails to declare _exit in <unistd.h>. */
84 /* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
85 <unistd.h>. */
86 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */
87 /* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is
88 included here. */
89 /* But avoid namespace pollution on glibc systems. */
90 #if !defined __GLIBC__ && !defined __osf__
91 # define __need_system_stdlib_h
92 # include <stdlib.h>
93 # undef __need_system_stdlib_h
94 #endif
96 /* Native Windows platforms declare _chdir, _getcwd, _rmdir in
97 <io.h> and/or <direct.h>, not in <unistd.h>.
98 They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(),
99 _lseek(), _read(), _unlink(), _write() in <io.h>. */
100 #if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
101 || defined GNULIB_POSIXCHECK) \
102 && (defined _WIN32 && ! defined __CYGWIN__))
103 # include <io.h> /* mingw32, mingw64 */
104 # include <direct.h> /* mingw64, MSVC 9 */
105 #elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \
106 || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \
107 || defined GNULIB_POSIXCHECK) \
108 && (defined _WIN32 && ! defined __CYGWIN__)
109 # include <io.h>
110 #endif
112 /* Native Windows platforms declare _execl*, _execv* in <process.h>. */
113 #if defined _WIN32 && !defined __CYGWIN__
114 # include <process.h>
115 #endif
117 /* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
118 NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */
119 /* But avoid namespace pollution on glibc systems. */
120 #if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
121 || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
122 && !defined __GLIBC__
123 # include <netdb.h>
124 #endif
126 /* Mac OS X 10.13, Solaris 11.4, and Android 9.0 declare getentropy in
127 <sys/random.h>, not in <unistd.h>. */
128 /* But avoid namespace pollution on glibc systems. */
129 #if (@GNULIB_GETENTROPY@ || defined GNULIB_POSIXCHECK) \
130 && ((defined __APPLE__ && defined __MACH__) || defined __sun \
131 || defined __ANDROID__) \
132 && @UNISTD_H_HAVE_SYS_RANDOM_H@ \
133 && !defined __GLIBC__
134 # include <sys/random.h>
135 #endif
137 /* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>. */
138 /* But avoid namespace pollution on glibc systems. */
139 #if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
140 && !defined __GLIBC__
141 # include <sys/stat.h>
142 #endif
144 /* MSVC defines off_t in <sys/types.h>.
145 May also define off_t to a 64-bit type on native Windows. */
146 /* Get off_t, ssize_t, mode_t. */
147 #include <sys/types.h>
149 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
151 /* The definition of _GL_ARG_NONNULL is copied here. */
153 /* The definition of _GL_WARN_ON_USE is copied here. */
156 /* Get getopt(), optarg, optind, opterr, optopt. */
157 #if @GNULIB_GETOPT_POSIX@ && @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
158 # include <getopt-cdefs.h>
159 # include <getopt-pfx-core.h>
160 #endif
162 #ifndef _GL_INLINE_HEADER_BEGIN
163 #error "Please include config.h first."
164 #endif
165 _GL_INLINE_HEADER_BEGIN
166 #ifndef _GL_UNISTD_INLINE
167 # define _GL_UNISTD_INLINE _GL_INLINE
168 #endif
170 /* Hide some function declarations from <winsock2.h>. */
172 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
173 # if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
174 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
175 # undef socket
176 # define socket socket_used_without_including_sys_socket_h
177 # undef connect
178 # define connect connect_used_without_including_sys_socket_h
179 # undef accept
180 # define accept accept_used_without_including_sys_socket_h
181 # undef bind
182 # define bind bind_used_without_including_sys_socket_h
183 # undef getpeername
184 # define getpeername getpeername_used_without_including_sys_socket_h
185 # undef getsockname
186 # define getsockname getsockname_used_without_including_sys_socket_h
187 # undef getsockopt
188 # define getsockopt getsockopt_used_without_including_sys_socket_h
189 # undef listen
190 # define listen listen_used_without_including_sys_socket_h
191 # undef recv
192 # define recv recv_used_without_including_sys_socket_h
193 # undef send
194 # define send send_used_without_including_sys_socket_h
195 # undef recvfrom
196 # define recvfrom recvfrom_used_without_including_sys_socket_h
197 # undef sendto
198 # define sendto sendto_used_without_including_sys_socket_h
199 # undef setsockopt
200 # define setsockopt setsockopt_used_without_including_sys_socket_h
201 # undef shutdown
202 # define shutdown shutdown_used_without_including_sys_socket_h
203 # else
204 _GL_WARN_ON_USE (socket,
205 "socket() used without including <sys/socket.h>");
206 _GL_WARN_ON_USE (connect,
207 "connect() used without including <sys/socket.h>");
208 _GL_WARN_ON_USE (accept,
209 "accept() used without including <sys/socket.h>");
210 _GL_WARN_ON_USE (bind,
211 "bind() used without including <sys/socket.h>");
212 _GL_WARN_ON_USE (getpeername,
213 "getpeername() used without including <sys/socket.h>");
214 _GL_WARN_ON_USE (getsockname,
215 "getsockname() used without including <sys/socket.h>");
216 _GL_WARN_ON_USE (getsockopt,
217 "getsockopt() used without including <sys/socket.h>");
218 _GL_WARN_ON_USE (listen,
219 "listen() used without including <sys/socket.h>");
220 _GL_WARN_ON_USE (recv,
221 "recv() used without including <sys/socket.h>");
222 _GL_WARN_ON_USE (send,
223 "send() used without including <sys/socket.h>");
224 _GL_WARN_ON_USE (recvfrom,
225 "recvfrom() used without including <sys/socket.h>");
226 _GL_WARN_ON_USE (sendto,
227 "sendto() used without including <sys/socket.h>");
228 _GL_WARN_ON_USE (setsockopt,
229 "setsockopt() used without including <sys/socket.h>");
230 _GL_WARN_ON_USE (shutdown,
231 "shutdown() used without including <sys/socket.h>");
232 # endif
233 # endif
234 # if !defined _@GUARD_PREFIX@_SYS_SELECT_H
235 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
236 # undef select
237 # define select select_used_without_including_sys_select_h
238 # else
239 _GL_WARN_ON_USE (select,
240 "select() used without including <sys/select.h>");
241 # endif
242 # endif
243 #endif
246 /* OS/2 EMX lacks these macros. */
247 #ifndef STDIN_FILENO
248 # define STDIN_FILENO 0
249 #endif
250 #ifndef STDOUT_FILENO
251 # define STDOUT_FILENO 1
252 #endif
253 #ifndef STDERR_FILENO
254 # define STDERR_FILENO 2
255 #endif
257 /* Ensure *_OK macros exist. */
258 #ifndef F_OK
259 # define F_OK 0
260 # define X_OK 1
261 # define W_OK 2
262 # define R_OK 4
263 #endif
266 /* Declare overridden functions. */
269 #if @GNULIB_ACCESS@
270 # if @REPLACE_ACCESS@
271 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
272 # undef access
273 # define access rpl_access
274 # endif
275 _GL_FUNCDECL_RPL (access, int, (const char *file, int mode)
276 _GL_ARG_NONNULL ((1)));
277 _GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
278 # elif defined _WIN32 && !defined __CYGWIN__
279 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
280 # undef access
281 # define access _access
282 # endif
283 _GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
284 # else
285 _GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
286 # endif
287 _GL_CXXALIASWARN (access);
288 #elif defined GNULIB_POSIXCHECK
289 # undef access
290 # if HAVE_RAW_DECL_ACCESS
291 /* The access() function is a security risk. */
292 _GL_WARN_ON_USE (access, "access does not always support X_OK - "
293 "use gnulib module access for portability; "
294 "also, this function is a security risk - "
295 "use the gnulib module faccessat instead");
296 # endif
297 #else
298 /* On native Windows, map 'access' to '_access', so that -loldnames is not
299 required. In C++ with GNULIB_NAMESPACE, avoid differences between
300 platforms by defining GNULIB_NAMESPACE::access always. */
301 # if defined _WIN32 && !defined __CYGWIN__
302 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
303 # undef access
304 # define access _access
305 # endif
306 _GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
307 # else
308 _GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
309 # endif
310 _GL_CXXALIASWARN (access);
311 #endif
314 #if @GNULIB_CHDIR@
315 # if defined _WIN32 && !defined __CYGWIN__
316 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
317 # undef chdir
318 # define chdir _chdir
319 # endif
320 _GL_CXXALIAS_MDA (chdir, int, (const char *file));
321 # else
322 _GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
323 # endif
324 _GL_CXXALIASWARN (chdir);
325 #elif defined GNULIB_POSIXCHECK
326 # undef chdir
327 # if HAVE_RAW_DECL_CHDIR
328 _GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
329 "use gnulib module chdir for portability");
330 # endif
331 #else
332 /* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not
333 required. In C++ with GNULIB_NAMESPACE, avoid differences between
334 platforms by defining GNULIB_NAMESPACE::chdir always. */
335 # if defined _WIN32 && !defined __CYGWIN__
336 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
337 # undef chdir
338 # define chdir _chdir
339 # endif
340 _GL_CXXALIAS_MDA (chdir, int, (const char *file));
341 # else
342 _GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
343 # endif
344 _GL_CXXALIASWARN (chdir);
345 #endif
348 #if @GNULIB_CHOWN@
349 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
350 to GID (if GID is not -1). Follow symbolic links.
351 Return 0 if successful, otherwise -1 and errno set.
352 See the POSIX:2008 specification
353 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */
354 # if @REPLACE_CHOWN@
355 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
356 # undef chown
357 # define chown rpl_chown
358 # endif
359 _GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
360 _GL_ARG_NONNULL ((1)));
361 _GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
362 # else
363 # if !@HAVE_CHOWN@
364 _GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
365 _GL_ARG_NONNULL ((1)));
366 # endif
367 _GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
368 # endif
369 _GL_CXXALIASWARN (chown);
370 #elif defined GNULIB_POSIXCHECK
371 # undef chown
372 # if HAVE_RAW_DECL_CHOWN
373 _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
374 "doesn't treat a uid or gid of -1 on some systems - "
375 "use gnulib module chown for portability");
376 # endif
377 #endif
380 #if @GNULIB_CLOSE@
381 # if @REPLACE_CLOSE@
382 /* Automatically included by modules that need a replacement for close. */
383 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
384 # undef close
385 # define close rpl_close
386 # endif
387 _GL_FUNCDECL_RPL (close, int, (int fd));
388 _GL_CXXALIAS_RPL (close, int, (int fd));
389 # elif defined _WIN32 && !defined __CYGWIN__
390 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
391 # undef close
392 # define close _close
393 # endif
394 _GL_CXXALIAS_MDA (close, int, (int fd));
395 # else
396 _GL_CXXALIAS_SYS (close, int, (int fd));
397 # endif
398 _GL_CXXALIASWARN (close);
399 #elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
400 # undef close
401 # define close close_used_without_requesting_gnulib_module_close
402 #elif defined GNULIB_POSIXCHECK
403 # undef close
404 /* Assume close is always declared. */
405 _GL_WARN_ON_USE (close, "close does not portably work on sockets - "
406 "use gnulib module close for portability");
407 #else
408 /* On native Windows, map 'close' to '_close', so that -loldnames is not
409 required. In C++ with GNULIB_NAMESPACE, avoid differences between
410 platforms by defining GNULIB_NAMESPACE::close always. */
411 # if defined _WIN32 && !defined __CYGWIN__
412 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
413 # undef close
414 # define close _close
415 # endif
416 _GL_CXXALIAS_MDA (close, int, (int fd));
417 # else
418 _GL_CXXALIAS_SYS (close, int, (int fd));
419 # endif
420 _GL_CXXALIASWARN (close);
421 #endif
424 #if @GNULIB_COPY_FILE_RANGE@
425 # if !@HAVE_COPY_FILE_RANGE@
426 _GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
427 int ofd, off_t *opos,
428 size_t len, unsigned flags));
429 _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
430 int ofd, off_t *opos,
431 size_t len, unsigned flags));
432 # endif
433 _GL_CXXALIASWARN (copy_file_range);
434 #elif defined GNULIB_POSIXCHECK
435 # if HAVE_RAW_DECL_COPY_FILE_RANGE
436 _GL_WARN_ON_USE (copy_file_range,
437 "copy_file_range is unportable - "
438 "use gnulib module copy_file_range for portability");
439 # endif
440 #endif
443 #if @GNULIB_DUP@
444 # if @REPLACE_DUP@
445 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
446 # define dup rpl_dup
447 # endif
448 _GL_FUNCDECL_RPL (dup, int, (int oldfd));
449 _GL_CXXALIAS_RPL (dup, int, (int oldfd));
450 # elif defined _WIN32 && !defined __CYGWIN__
451 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
452 # undef dup
453 # define dup _dup
454 # endif
455 _GL_CXXALIAS_MDA (dup, int, (int oldfd));
456 # else
457 _GL_CXXALIAS_SYS (dup, int, (int oldfd));
458 # endif
459 _GL_CXXALIASWARN (dup);
460 #elif defined GNULIB_POSIXCHECK
461 # undef dup
462 # if HAVE_RAW_DECL_DUP
463 _GL_WARN_ON_USE (dup, "dup is unportable - "
464 "use gnulib module dup for portability");
465 # endif
466 #else
467 /* On native Windows, map 'dup' to '_dup', so that -loldnames is not
468 required. In C++ with GNULIB_NAMESPACE, avoid differences between
469 platforms by defining GNULIB_NAMESPACE::dup always. */
470 # if defined _WIN32 && !defined __CYGWIN__
471 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
472 # undef dup
473 # define dup _dup
474 # endif
475 _GL_CXXALIAS_MDA (dup, int, (int oldfd));
476 # else
477 _GL_CXXALIAS_SYS (dup, int, (int oldfd));
478 # endif
479 _GL_CXXALIASWARN (dup);
480 #endif
483 #if @GNULIB_DUP2@
484 /* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
485 NEWFD = OLDFD, otherwise close NEWFD first if it is open.
486 Return newfd if successful, otherwise -1 and errno set.
487 See the POSIX:2008 specification
488 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */
489 # if @REPLACE_DUP2@
490 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
491 # define dup2 rpl_dup2
492 # endif
493 _GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
494 _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
495 # elif defined _WIN32 && !defined __CYGWIN__
496 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
497 # undef dup2
498 # define dup2 _dup2
499 # endif
500 _GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
501 # else
502 _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
503 # endif
504 _GL_CXXALIASWARN (dup2);
505 #elif defined GNULIB_POSIXCHECK
506 # undef dup2
507 # if HAVE_RAW_DECL_DUP2
508 _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
509 "use gnulib module dup2 for portability");
510 # endif
511 #else
512 /* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not
513 required. In C++ with GNULIB_NAMESPACE, avoid differences between
514 platforms by defining GNULIB_NAMESPACE::dup2 always. */
515 # if defined _WIN32 && !defined __CYGWIN__
516 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
517 # undef dup2
518 # define dup2 _dup2
519 # endif
520 _GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
521 # else
522 _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
523 # endif
524 _GL_CXXALIASWARN (dup2);
525 #endif
528 #if @GNULIB_DUP3@
529 /* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
530 specified flags.
531 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
532 and O_TEXT, O_BINARY (defined in "binary-io.h").
533 Close NEWFD first if it is open.
534 Return newfd if successful, otherwise -1 and errno set.
535 See the Linux man page at
536 <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
537 # if @HAVE_DUP3@
538 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
539 # define dup3 rpl_dup3
540 # endif
541 _GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
542 _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
543 # else
544 _GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
545 _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
546 # endif
547 _GL_CXXALIASWARN (dup3);
548 #elif defined GNULIB_POSIXCHECK
549 # undef dup3
550 # if HAVE_RAW_DECL_DUP3
551 _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
552 "use gnulib module dup3 for portability");
553 # endif
554 #endif
557 #if @GNULIB_ENVIRON@
558 # if defined __CYGWIN__ && !defined __i386__
559 /* The 'environ' variable is defined in a DLL. Therefore its declaration needs
560 the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it.
561 This leads to a link error on 64-bit Cygwin when the option
562 -Wl,--disable-auto-import is in use. */
563 _GL_EXTERN_C __declspec(dllimport) char **environ;
564 # endif
565 # if !@HAVE_DECL_ENVIRON@
566 /* Set of environment variables and values. An array of strings of the form
567 "VARIABLE=VALUE", terminated with a NULL. */
568 # if defined __APPLE__ && defined __MACH__
569 # include <TargetConditionals.h>
570 # if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
571 # define _GL_USE_CRT_EXTERNS
572 # endif
573 # endif
574 # ifdef _GL_USE_CRT_EXTERNS
575 # include <crt_externs.h>
576 # define environ (*_NSGetEnviron ())
577 # else
578 # ifdef __cplusplus
579 extern "C" {
580 # endif
581 extern char **environ;
582 # ifdef __cplusplus
584 # endif
585 # endif
586 # endif
587 #elif defined GNULIB_POSIXCHECK
588 # if HAVE_RAW_DECL_ENVIRON
589 _GL_UNISTD_INLINE char ***
590 _GL_WARN_ON_USE_ATTRIBUTE ("environ is unportable - "
591 "use gnulib module environ for portability")
592 rpl_environ (void)
594 return &environ;
596 # undef environ
597 # define environ (*rpl_environ ())
598 # endif
599 #endif
602 #if @GNULIB_EUIDACCESS@
603 /* Like access(), except that it uses the effective user id and group id of
604 the current process. */
605 # if !@HAVE_EUIDACCESS@
606 _GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
607 _GL_ARG_NONNULL ((1)));
608 # endif
609 _GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
610 _GL_CXXALIASWARN (euidaccess);
611 # if defined GNULIB_POSIXCHECK
612 /* Like access(), this function is a security risk. */
613 _GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
614 "use the gnulib module faccessat instead");
615 # endif
616 #elif defined GNULIB_POSIXCHECK
617 # undef euidaccess
618 # if HAVE_RAW_DECL_EUIDACCESS
619 _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
620 "use gnulib module euidaccess for portability");
621 # endif
622 #endif
625 /* On native Windows, map 'execl' to '_execl', so that -loldnames is not
626 required. In C++ with GNULIB_NAMESPACE, avoid differences between
627 platforms by defining GNULIB_NAMESPACE::execl always. */
628 #if defined _WIN32 && !defined __CYGWIN__
629 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
630 # undef execl
631 # define execl _execl
632 # endif
633 _GL_CXXALIAS_MDA (execl, intptr_t, (const char *program, const char *arg, ...));
634 #else
635 _GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
636 #endif
637 _GL_CXXALIASWARN (execl);
639 /* On native Windows, map 'execle' to '_execle', so that -loldnames is not
640 required. In C++ with GNULIB_NAMESPACE, avoid differences between
641 platforms by defining GNULIB_NAMESPACE::execle always. */
642 #if defined _WIN32 && !defined __CYGWIN__
643 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
644 # undef execle
645 # define execle _execle
646 # endif
647 _GL_CXXALIAS_MDA (execle, intptr_t, (const char *program, const char *arg, ...));
648 #else
649 _GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
650 #endif
651 _GL_CXXALIASWARN (execle);
653 /* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not
654 required. In C++ with GNULIB_NAMESPACE, avoid differences between
655 platforms by defining GNULIB_NAMESPACE::execlp always. */
656 #if defined _WIN32 && !defined __CYGWIN__
657 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
658 # undef execlp
659 # define execlp _execlp
660 # endif
661 _GL_CXXALIAS_MDA (execlp, intptr_t, (const char *program, const char *arg, ...));
662 #else
663 _GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
664 #endif
665 _GL_CXXALIASWARN (execlp);
668 /* On native Windows, map 'execv' to '_execv', so that -loldnames is not
669 required. In C++ with GNULIB_NAMESPACE, avoid differences between
670 platforms by defining GNULIB_NAMESPACE::execv always. */
671 #if defined _WIN32 && !defined __CYGWIN__
672 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
673 # undef execv
674 # define execv _execv
675 # endif
676 _GL_CXXALIAS_MDA (execv, intptr_t,
677 (const char *program, const char * const *argv));
678 #else
679 _GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
680 #endif
681 _GL_CXXALIASWARN (execv);
683 /* On native Windows, map 'execve' to '_execve', so that -loldnames is not
684 required. In C++ with GNULIB_NAMESPACE, avoid differences between
685 platforms by defining GNULIB_NAMESPACE::execve always. */
686 #if defined _WIN32 && !defined __CYGWIN__
687 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
688 # undef execve
689 # define execve _execve
690 # endif
691 _GL_CXXALIAS_MDA (execve, intptr_t,
692 (const char *program, const char * const *argv,
693 const char * const *env));
694 #else
695 _GL_CXXALIAS_SYS (execve, int,
696 (const char *program, char * const *argv, char * const *env));
697 #endif
698 _GL_CXXALIASWARN (execve);
700 /* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not
701 required. In C++ with GNULIB_NAMESPACE, avoid differences between
702 platforms by defining GNULIB_NAMESPACE::execvp always. */
703 #if defined _WIN32 && !defined __CYGWIN__
704 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
705 # undef execvp
706 # define execvp _execvp
707 # endif
708 _GL_CXXALIAS_MDA (execvp, intptr_t,
709 (const char *program, const char * const *argv));
710 #else
711 _GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
712 #endif
713 _GL_CXXALIASWARN (execvp);
715 /* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not
716 required. In C++ with GNULIB_NAMESPACE, avoid differences between
717 platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have
718 it. */
719 #if defined _WIN32 && !defined __CYGWIN__
720 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
721 # undef execvpe
722 # define execvpe _execvpe
723 # endif
724 _GL_CXXALIAS_MDA (execvpe, intptr_t,
725 (const char *program, const char * const *argv,
726 const char * const *env));
727 #else
728 # if @HAVE_DECL_EXECVPE@
729 _GL_CXXALIAS_SYS (execvpe, int,
730 (const char *program, char * const *argv, char * const *env));
731 # endif
732 #endif
733 #if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_EXECVPE@
734 _GL_CXXALIASWARN (execvpe);
735 #endif
738 #if @GNULIB_FACCESSAT@
739 # if @REPLACE_FACCESSAT@
740 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
741 # undef faccessat
742 # define faccessat rpl_faccessat
743 # endif
744 _GL_FUNCDECL_RPL (faccessat, int,
745 (int fd, char const *name, int mode, int flag)
746 _GL_ARG_NONNULL ((2)));
747 _GL_CXXALIAS_RPL (faccessat, int,
748 (int fd, char const *name, int mode, int flag));
749 # else
750 # if !@HAVE_FACCESSAT@
751 _GL_FUNCDECL_SYS (faccessat, int,
752 (int fd, char const *file, int mode, int flag)
753 _GL_ARG_NONNULL ((2)));
754 # endif
755 _GL_CXXALIAS_SYS (faccessat, int,
756 (int fd, char const *file, int mode, int flag));
757 # endif
758 _GL_CXXALIASWARN (faccessat);
759 #elif defined GNULIB_POSIXCHECK
760 # undef faccessat
761 # if HAVE_RAW_DECL_FACCESSAT
762 _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
763 "use gnulib module faccessat for portability");
764 # endif
765 #endif
768 #if @GNULIB_FCHDIR@
769 /* Change the process' current working directory to the directory on which
770 the given file descriptor is open.
771 Return 0 if successful, otherwise -1 and errno set.
772 See the POSIX:2008 specification
773 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */
774 # if ! @HAVE_FCHDIR@
775 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
777 /* Gnulib internal hooks needed to maintain the fchdir metadata. */
778 _GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
779 _GL_ARG_NONNULL ((2));
780 _GL_EXTERN_C void _gl_unregister_fd (int fd);
781 _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
782 _GL_EXTERN_C const char *_gl_directory_name (int fd);
784 # else
785 # if !@HAVE_DECL_FCHDIR@
786 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
787 # endif
788 # endif
789 _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
790 _GL_CXXALIASWARN (fchdir);
791 #elif defined GNULIB_POSIXCHECK
792 # undef fchdir
793 # if HAVE_RAW_DECL_FCHDIR
794 _GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
795 "use gnulib module fchdir for portability");
796 # endif
797 #endif
800 #if @GNULIB_FCHOWNAT@
801 # if @REPLACE_FCHOWNAT@
802 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
803 # undef fchownat
804 # define fchownat rpl_fchownat
805 # endif
806 _GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
807 uid_t owner, gid_t group, int flag)
808 _GL_ARG_NONNULL ((2)));
809 _GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
810 uid_t owner, gid_t group, int flag));
811 # else
812 # if !@HAVE_FCHOWNAT@
813 _GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
814 uid_t owner, gid_t group, int flag)
815 _GL_ARG_NONNULL ((2)));
816 # endif
817 _GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
818 uid_t owner, gid_t group, int flag));
819 # endif
820 _GL_CXXALIASWARN (fchownat);
821 #elif defined GNULIB_POSIXCHECK
822 # undef fchownat
823 # if HAVE_RAW_DECL_FCHOWNAT
824 _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
825 "use gnulib module openat for portability");
826 # endif
827 #endif
830 #if @GNULIB_FDATASYNC@
831 /* Synchronize changes to a file.
832 Return 0 if successful, otherwise -1 and errno set.
833 See POSIX:2008 specification
834 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */
835 # if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@
836 _GL_FUNCDECL_SYS (fdatasync, int, (int fd));
837 # endif
838 _GL_CXXALIAS_SYS (fdatasync, int, (int fd));
839 _GL_CXXALIASWARN (fdatasync);
840 #elif defined GNULIB_POSIXCHECK
841 # undef fdatasync
842 # if HAVE_RAW_DECL_FDATASYNC
843 _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
844 "use gnulib module fdatasync for portability");
845 # endif
846 #endif
849 #if @GNULIB_FSYNC@
850 /* Synchronize changes, including metadata, to a file.
851 Return 0 if successful, otherwise -1 and errno set.
852 See POSIX:2008 specification
853 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */
854 # if !@HAVE_FSYNC@
855 _GL_FUNCDECL_SYS (fsync, int, (int fd));
856 # endif
857 _GL_CXXALIAS_SYS (fsync, int, (int fd));
858 _GL_CXXALIASWARN (fsync);
859 #elif defined GNULIB_POSIXCHECK
860 # undef fsync
861 # if HAVE_RAW_DECL_FSYNC
862 _GL_WARN_ON_USE (fsync, "fsync is unportable - "
863 "use gnulib module fsync for portability");
864 # endif
865 #endif
868 #if @GNULIB_FTRUNCATE@
869 /* Change the size of the file to which FD is opened to become equal to LENGTH.
870 Return 0 if successful, otherwise -1 and errno set.
871 See the POSIX:2008 specification
872 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */
873 # if @REPLACE_FTRUNCATE@
874 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
875 # undef ftruncate
876 # define ftruncate rpl_ftruncate
877 # endif
878 _GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
879 _GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
880 # else
881 # if !@HAVE_FTRUNCATE@
882 _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
883 # endif
884 _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
885 # endif
886 _GL_CXXALIASWARN (ftruncate);
887 #elif defined GNULIB_POSIXCHECK
888 # undef ftruncate
889 # if HAVE_RAW_DECL_FTRUNCATE
890 _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
891 "use gnulib module ftruncate for portability");
892 # endif
893 #endif
896 #if @GNULIB_GETCWD@
897 /* Get the name of the current working directory, and put it in SIZE bytes
898 of BUF.
899 Return BUF if successful, or NULL if the directory couldn't be determined
900 or SIZE was too small.
901 See the POSIX:2008 specification
902 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
903 Additionally, the gnulib module 'getcwd' guarantees the following GNU
904 extension: If BUF is NULL, an array is allocated with 'malloc'; the array
905 is SIZE bytes long, unless SIZE == 0, in which case it is as big as
906 necessary. */
907 # if @REPLACE_GETCWD@
908 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
909 # define getcwd rpl_getcwd
910 # endif
911 _GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
912 _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
913 # elif defined _WIN32 && !defined __CYGWIN__
914 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
915 # undef getcwd
916 # define getcwd _getcwd
917 # endif
918 _GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size));
919 # else
920 /* Need to cast, because on mingw, the second parameter is
921 int size. */
922 _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
923 # endif
924 _GL_CXXALIASWARN (getcwd);
925 #elif defined GNULIB_POSIXCHECK
926 # undef getcwd
927 # if HAVE_RAW_DECL_GETCWD
928 _GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
929 "use gnulib module getcwd for portability");
930 # endif
931 #else
932 /* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not
933 required. In C++ with GNULIB_NAMESPACE, avoid differences between
934 platforms by defining GNULIB_NAMESPACE::getcwd always. */
935 # if defined _WIN32 && !defined __CYGWIN__
936 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
937 # undef getcwd
938 # define getcwd _getcwd
939 # endif
940 _GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size));
941 # else
942 _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
943 # endif
944 _GL_CXXALIASWARN (getcwd);
945 #endif
948 #if @GNULIB_GETDOMAINNAME@
949 /* Return the NIS domain name of the machine.
950 WARNING! The NIS domain name is unrelated to the fully qualified host name
951 of the machine. It is also unrelated to email addresses.
952 WARNING! The NIS domain name is usually the empty string or "(none)" when
953 not using NIS.
955 Put up to LEN bytes of the NIS domain name into NAME.
956 Null terminate it if the name is shorter than LEN.
957 If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
958 Return 0 if successful, otherwise set errno and return -1. */
959 # if @REPLACE_GETDOMAINNAME@
960 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
961 # undef getdomainname
962 # define getdomainname rpl_getdomainname
963 # endif
964 _GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
965 _GL_ARG_NONNULL ((1)));
966 _GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
967 # else
968 # if !@HAVE_DECL_GETDOMAINNAME@
969 _GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
970 _GL_ARG_NONNULL ((1)));
971 # endif
972 _GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
973 # endif
974 _GL_CXXALIASWARN (getdomainname);
975 #elif defined GNULIB_POSIXCHECK
976 # undef getdomainname
977 # if HAVE_RAW_DECL_GETDOMAINNAME
978 _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
979 "use gnulib module getdomainname for portability");
980 # endif
981 #endif
984 #if @GNULIB_GETDTABLESIZE@
985 /* Return the maximum number of file descriptors in the current process.
986 In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
987 # if @REPLACE_GETDTABLESIZE@
988 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
989 # undef getdtablesize
990 # define getdtablesize rpl_getdtablesize
991 # endif
992 _GL_FUNCDECL_RPL (getdtablesize, int, (void));
993 _GL_CXXALIAS_RPL (getdtablesize, int, (void));
994 # else
995 # if !@HAVE_GETDTABLESIZE@
996 _GL_FUNCDECL_SYS (getdtablesize, int, (void));
997 # endif
998 /* Need to cast, because on AIX, the parameter list is
999 (...). */
1000 _GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void));
1001 # endif
1002 _GL_CXXALIASWARN (getdtablesize);
1003 #elif defined GNULIB_POSIXCHECK
1004 # undef getdtablesize
1005 # if HAVE_RAW_DECL_GETDTABLESIZE
1006 _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
1007 "use gnulib module getdtablesize for portability");
1008 # endif
1009 #endif
1012 #if @GNULIB_GETENTROPY@
1013 /* Fill a buffer with random bytes. */
1014 # if !@HAVE_GETENTROPY@
1015 _GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length));
1016 # endif
1017 _GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length));
1018 _GL_CXXALIASWARN (getentropy);
1019 #elif defined GNULIB_POSIXCHECK
1020 # undef getentropy
1021 # if HAVE_RAW_DECL_GETENTROPY
1022 _GL_WARN_ON_USE (getentropy, "getentropy is unportable - "
1023 "use gnulib module getentropy for portability");
1024 # endif
1025 #endif
1028 #if @GNULIB_GETGROUPS@
1029 /* Return the supplemental groups that the current process belongs to.
1030 It is unspecified whether the effective group id is in the list.
1031 If N is 0, return the group count; otherwise, N describes how many
1032 entries are available in GROUPS. Return -1 and set errno if N is
1033 not 0 and not large enough. Fails with ENOSYS on some systems. */
1034 # if @REPLACE_GETGROUPS@
1035 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1036 # undef getgroups
1037 # define getgroups rpl_getgroups
1038 # endif
1039 _GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
1040 _GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
1041 # else
1042 # if !@HAVE_GETGROUPS@
1043 _GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
1044 # endif
1045 _GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
1046 # endif
1047 _GL_CXXALIASWARN (getgroups);
1048 #elif defined GNULIB_POSIXCHECK
1049 # undef getgroups
1050 # if HAVE_RAW_DECL_GETGROUPS
1051 _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
1052 "use gnulib module getgroups for portability");
1053 # endif
1054 #endif
1057 #if @GNULIB_GETHOSTNAME@
1058 /* Return the standard host name of the machine.
1059 WARNING! The host name may or may not be fully qualified.
1061 Put up to LEN bytes of the host name into NAME.
1062 Null terminate it if the name is shorter than LEN.
1063 If the host name is longer than LEN, set errno = EINVAL and return -1.
1064 Return 0 if successful, otherwise set errno and return -1. */
1065 # if @UNISTD_H_HAVE_WINSOCK2_H@
1066 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1067 # undef gethostname
1068 # define gethostname rpl_gethostname
1069 # endif
1070 _GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
1071 _GL_ARG_NONNULL ((1)));
1072 _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
1073 # else
1074 # if !@HAVE_GETHOSTNAME@
1075 _GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
1076 _GL_ARG_NONNULL ((1)));
1077 # endif
1078 /* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
1079 parameter is
1080 int len. */
1081 _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
1082 # endif
1083 _GL_CXXALIASWARN (gethostname);
1084 #elif @UNISTD_H_HAVE_WINSOCK2_H@
1085 # undef gethostname
1086 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
1087 #elif defined GNULIB_POSIXCHECK
1088 # undef gethostname
1089 # if HAVE_RAW_DECL_GETHOSTNAME
1090 _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
1091 "use gnulib module gethostname for portability");
1092 # endif
1093 #endif
1096 #if @GNULIB_GETLOGIN@
1097 /* Returns the user's login name, or NULL if it cannot be found. Upon error,
1098 returns NULL with errno set.
1100 See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
1102 Most programs don't need to use this function, because the information is
1103 available through environment variables:
1104 ${LOGNAME-$USER} on Unix platforms,
1105 $USERNAME on native Windows platforms.
1107 # if !@HAVE_DECL_GETLOGIN@
1108 _GL_FUNCDECL_SYS (getlogin, char *, (void));
1109 # endif
1110 _GL_CXXALIAS_SYS (getlogin, char *, (void));
1111 _GL_CXXALIASWARN (getlogin);
1112 #elif defined GNULIB_POSIXCHECK
1113 # undef getlogin
1114 # if HAVE_RAW_DECL_GETLOGIN
1115 _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
1116 "use gnulib module getlogin for portability");
1117 # endif
1118 #endif
1121 #if @GNULIB_GETLOGIN_R@
1122 /* Copies the user's login name to NAME.
1123 The array pointed to by NAME has room for SIZE bytes.
1125 Returns 0 if successful. Upon error, an error number is returned, or -1 in
1126 the case that the login name cannot be found but no specific error is
1127 provided (this case is hopefully rare but is left open by the POSIX spec).
1129 See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
1131 Most programs don't need to use this function, because the information is
1132 available through environment variables:
1133 ${LOGNAME-$USER} on Unix platforms,
1134 $USERNAME on native Windows platforms.
1136 # if @REPLACE_GETLOGIN_R@
1137 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1138 # define getlogin_r rpl_getlogin_r
1139 # endif
1140 _GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
1141 _GL_ARG_NONNULL ((1)));
1142 _GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
1143 # else
1144 # if !@HAVE_DECL_GETLOGIN_R@
1145 _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
1146 _GL_ARG_NONNULL ((1)));
1147 # endif
1148 /* Need to cast, because on Solaris 10 systems, the second argument is
1149 int size. */
1150 _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
1151 # endif
1152 _GL_CXXALIASWARN (getlogin_r);
1153 #elif defined GNULIB_POSIXCHECK
1154 # undef getlogin_r
1155 # if HAVE_RAW_DECL_GETLOGIN_R
1156 _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
1157 "use gnulib module getlogin_r for portability");
1158 # endif
1159 #endif
1162 #if @GNULIB_GETPAGESIZE@
1163 # if @REPLACE_GETPAGESIZE@
1164 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1165 # define getpagesize rpl_getpagesize
1166 # endif
1167 _GL_FUNCDECL_RPL (getpagesize, int, (void));
1168 _GL_CXXALIAS_RPL (getpagesize, int, (void));
1169 # else
1170 /* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if
1171 the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */
1172 # if defined __hpux
1173 _GL_FUNCDECL_SYS (getpagesize, int, (void));
1174 # endif
1175 # if !@HAVE_GETPAGESIZE@
1176 # if !defined getpagesize
1177 /* This is for POSIX systems. */
1178 # if !defined _gl_getpagesize && defined _SC_PAGESIZE
1179 # if ! (defined __VMS && __VMS_VER < 70000000)
1180 # define _gl_getpagesize() sysconf (_SC_PAGESIZE)
1181 # endif
1182 # endif
1183 /* This is for older VMS. */
1184 # if !defined _gl_getpagesize && defined __VMS
1185 # ifdef __ALPHA
1186 # define _gl_getpagesize() 8192
1187 # else
1188 # define _gl_getpagesize() 512
1189 # endif
1190 # endif
1191 /* This is for BeOS. */
1192 # if !defined _gl_getpagesize && @HAVE_OS_H@
1193 # include <OS.h>
1194 # if defined B_PAGE_SIZE
1195 # define _gl_getpagesize() B_PAGE_SIZE
1196 # endif
1197 # endif
1198 /* This is for AmigaOS4.0. */
1199 # if !defined _gl_getpagesize && defined __amigaos4__
1200 # define _gl_getpagesize() 2048
1201 # endif
1202 /* This is for older Unix systems. */
1203 # if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
1204 # include <sys/param.h>
1205 # ifdef EXEC_PAGESIZE
1206 # define _gl_getpagesize() EXEC_PAGESIZE
1207 # else
1208 # ifdef NBPG
1209 # ifndef CLSIZE
1210 # define CLSIZE 1
1211 # endif
1212 # define _gl_getpagesize() (NBPG * CLSIZE)
1213 # else
1214 # ifdef NBPC
1215 # define _gl_getpagesize() NBPC
1216 # endif
1217 # endif
1218 # endif
1219 # endif
1220 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1221 # define getpagesize() _gl_getpagesize ()
1222 # else
1223 # if !GNULIB_defined_getpagesize_function
1224 _GL_UNISTD_INLINE int
1225 getpagesize ()
1227 return _gl_getpagesize ();
1229 # define GNULIB_defined_getpagesize_function 1
1230 # endif
1231 # endif
1232 # endif
1233 # endif
1234 /* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t. */
1235 _GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
1236 # endif
1237 # if @HAVE_DECL_GETPAGESIZE@
1238 _GL_CXXALIASWARN (getpagesize);
1239 # endif
1240 #elif defined GNULIB_POSIXCHECK
1241 # undef getpagesize
1242 # if HAVE_RAW_DECL_GETPAGESIZE
1243 _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
1244 "use gnulib module getpagesize for portability");
1245 # endif
1246 #endif
1249 #if @GNULIB_GETPASS@
1250 /* Function getpass() from module 'getpass':
1251 Read a password from /dev/tty or stdin.
1252 Function getpass() from module 'getpass-gnu':
1253 Read a password of arbitrary length from /dev/tty or stdin. */
1254 # if @REPLACE_GETPASS@
1255 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1256 # undef getpass
1257 # define getpass rpl_getpass
1258 # endif
1259 _GL_FUNCDECL_RPL (getpass, char *, (const char *prompt)
1260 _GL_ARG_NONNULL ((1)));
1261 _GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
1262 # else
1263 # if !@HAVE_GETPASS@
1264 _GL_FUNCDECL_SYS (getpass, char *, (const char *prompt)
1265 _GL_ARG_NONNULL ((1)));
1266 # endif
1267 _GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
1268 # endif
1269 _GL_CXXALIASWARN (getpass);
1270 #elif defined GNULIB_POSIXCHECK
1271 # undef getpass
1272 # if HAVE_RAW_DECL_GETPASS
1273 _GL_WARN_ON_USE (getpass, "getpass is unportable - "
1274 "use gnulib module getpass or getpass-gnu for portability");
1275 # endif
1276 #endif
1279 /* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not
1280 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1281 platforms by defining GNULIB_NAMESPACE::getpid always. */
1282 #if defined _WIN32 && !defined __CYGWIN__
1283 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1284 # undef getpid
1285 # define getpid _getpid
1286 # endif
1287 _GL_CXXALIAS_MDA (getpid, int, (void));
1288 #else
1289 _GL_CXXALIAS_SYS (getpid, pid_t, (void));
1290 #endif
1291 _GL_CXXALIASWARN (getpid);
1294 #if @GNULIB_GETUSERSHELL@
1295 /* Return the next valid login shell on the system, or NULL when the end of
1296 the list has been reached. */
1297 # if !@HAVE_DECL_GETUSERSHELL@
1298 _GL_FUNCDECL_SYS (getusershell, char *, (void));
1299 # endif
1300 _GL_CXXALIAS_SYS (getusershell, char *, (void));
1301 _GL_CXXALIASWARN (getusershell);
1302 #elif defined GNULIB_POSIXCHECK
1303 # undef getusershell
1304 # if HAVE_RAW_DECL_GETUSERSHELL
1305 _GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
1306 "use gnulib module getusershell for portability");
1307 # endif
1308 #endif
1310 #if @GNULIB_GETUSERSHELL@
1311 /* Rewind to pointer that is advanced at each getusershell() call. */
1312 # if !@HAVE_DECL_GETUSERSHELL@
1313 _GL_FUNCDECL_SYS (setusershell, void, (void));
1314 # endif
1315 _GL_CXXALIAS_SYS (setusershell, void, (void));
1316 _GL_CXXALIASWARN (setusershell);
1317 #elif defined GNULIB_POSIXCHECK
1318 # undef setusershell
1319 # if HAVE_RAW_DECL_SETUSERSHELL
1320 _GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
1321 "use gnulib module getusershell for portability");
1322 # endif
1323 #endif
1325 #if @GNULIB_GETUSERSHELL@
1326 /* Free the pointer that is advanced at each getusershell() call and
1327 associated resources. */
1328 # if !@HAVE_DECL_GETUSERSHELL@
1329 _GL_FUNCDECL_SYS (endusershell, void, (void));
1330 # endif
1331 _GL_CXXALIAS_SYS (endusershell, void, (void));
1332 _GL_CXXALIASWARN (endusershell);
1333 #elif defined GNULIB_POSIXCHECK
1334 # undef endusershell
1335 # if HAVE_RAW_DECL_ENDUSERSHELL
1336 _GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
1337 "use gnulib module getusershell for portability");
1338 # endif
1339 #endif
1342 #if @GNULIB_GROUP_MEMBER@
1343 /* Determine whether group id is in calling user's group list. */
1344 # if !@HAVE_GROUP_MEMBER@
1345 _GL_FUNCDECL_SYS (group_member, int, (gid_t gid));
1346 # endif
1347 _GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
1348 _GL_CXXALIASWARN (group_member);
1349 #elif defined GNULIB_POSIXCHECK
1350 # undef group_member
1351 # if HAVE_RAW_DECL_GROUP_MEMBER
1352 _GL_WARN_ON_USE (group_member, "group_member is unportable - "
1353 "use gnulib module group-member for portability");
1354 # endif
1355 #endif
1358 #if @GNULIB_ISATTY@
1359 # if @REPLACE_ISATTY@
1360 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1361 # undef isatty
1362 # define isatty rpl_isatty
1363 # endif
1364 _GL_FUNCDECL_RPL (isatty, int, (int fd));
1365 _GL_CXXALIAS_RPL (isatty, int, (int fd));
1366 # elif defined _WIN32 && !defined __CYGWIN__
1367 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1368 # undef isatty
1369 # define isatty _isatty
1370 # endif
1371 _GL_CXXALIAS_MDA (isatty, int, (int fd));
1372 # else
1373 _GL_CXXALIAS_SYS (isatty, int, (int fd));
1374 # endif
1375 _GL_CXXALIASWARN (isatty);
1376 #elif defined GNULIB_POSIXCHECK
1377 # undef isatty
1378 # if HAVE_RAW_DECL_ISATTY
1379 _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
1380 "use gnulib module isatty for portability");
1381 # endif
1382 #else
1383 /* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not
1384 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1385 platforms by defining GNULIB_NAMESPACE::isatty always. */
1386 # if defined _WIN32 && !defined __CYGWIN__
1387 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1388 # undef isatty
1389 # define isatty _isatty
1390 # endif
1391 _GL_CXXALIAS_MDA (isatty, int, (int fd));
1392 # else
1393 _GL_CXXALIAS_SYS (isatty, int, (int fd));
1394 # endif
1395 _GL_CXXALIASWARN (isatty);
1396 #endif
1399 #if @GNULIB_LCHOWN@
1400 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
1401 to GID (if GID is not -1). Do not follow symbolic links.
1402 Return 0 if successful, otherwise -1 and errno set.
1403 See the POSIX:2008 specification
1404 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */
1405 # if @REPLACE_LCHOWN@
1406 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1407 # undef lchown
1408 # define lchown rpl_lchown
1409 # endif
1410 _GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
1411 _GL_ARG_NONNULL ((1)));
1412 _GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
1413 # else
1414 # if !@HAVE_LCHOWN@
1415 _GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
1416 _GL_ARG_NONNULL ((1)));
1417 # endif
1418 _GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
1419 # endif
1420 _GL_CXXALIASWARN (lchown);
1421 #elif defined GNULIB_POSIXCHECK
1422 # undef lchown
1423 # if HAVE_RAW_DECL_LCHOWN
1424 _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
1425 "use gnulib module lchown for portability");
1426 # endif
1427 #endif
1430 #if @GNULIB_LINK@
1431 /* Create a new hard link for an existing file.
1432 Return 0 if successful, otherwise -1 and errno set.
1433 See POSIX:2008 specification
1434 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */
1435 # if @REPLACE_LINK@
1436 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1437 # define link rpl_link
1438 # endif
1439 _GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
1440 _GL_ARG_NONNULL ((1, 2)));
1441 _GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
1442 # else
1443 # if !@HAVE_LINK@
1444 _GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
1445 _GL_ARG_NONNULL ((1, 2)));
1446 # endif
1447 _GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
1448 # endif
1449 _GL_CXXALIASWARN (link);
1450 #elif defined GNULIB_POSIXCHECK
1451 # undef link
1452 # if HAVE_RAW_DECL_LINK
1453 _GL_WARN_ON_USE (link, "link is unportable - "
1454 "use gnulib module link for portability");
1455 # endif
1456 #endif
1459 #if @GNULIB_LINKAT@
1460 /* Create a new hard link for an existing file, relative to two
1461 directories. FLAG controls whether symlinks are followed.
1462 Return 0 if successful, otherwise -1 and errno set. */
1463 # if @REPLACE_LINKAT@
1464 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1465 # undef linkat
1466 # define linkat rpl_linkat
1467 # endif
1468 _GL_FUNCDECL_RPL (linkat, int,
1469 (int fd1, const char *path1, int fd2, const char *path2,
1470 int flag)
1471 _GL_ARG_NONNULL ((2, 4)));
1472 _GL_CXXALIAS_RPL (linkat, int,
1473 (int fd1, const char *path1, int fd2, const char *path2,
1474 int flag));
1475 # else
1476 # if !@HAVE_LINKAT@
1477 _GL_FUNCDECL_SYS (linkat, int,
1478 (int fd1, const char *path1, int fd2, const char *path2,
1479 int flag)
1480 _GL_ARG_NONNULL ((2, 4)));
1481 # endif
1482 _GL_CXXALIAS_SYS (linkat, int,
1483 (int fd1, const char *path1, int fd2, const char *path2,
1484 int flag));
1485 # endif
1486 _GL_CXXALIASWARN (linkat);
1487 #elif defined GNULIB_POSIXCHECK
1488 # undef linkat
1489 # if HAVE_RAW_DECL_LINKAT
1490 _GL_WARN_ON_USE (linkat, "linkat is unportable - "
1491 "use gnulib module linkat for portability");
1492 # endif
1493 #endif
1496 #if @GNULIB_LSEEK@
1497 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
1498 Return the new offset if successful, otherwise -1 and errno set.
1499 See the POSIX:2008 specification
1500 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */
1501 # if @REPLACE_LSEEK@
1502 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1503 # define lseek rpl_lseek
1504 # endif
1505 _GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
1506 _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
1507 # elif defined _WIN32 && !defined __CYGWIN__
1508 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1509 # undef lseek
1510 # define lseek _lseek
1511 # endif
1512 _GL_CXXALIAS_MDA (lseek, off_t, (int fd, off_t offset, int whence));
1513 # else
1514 _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
1515 # endif
1516 _GL_CXXALIASWARN (lseek);
1517 #elif defined GNULIB_POSIXCHECK
1518 # undef lseek
1519 # if HAVE_RAW_DECL_LSEEK
1520 _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
1521 "systems - use gnulib module lseek for portability");
1522 # endif
1523 #else
1524 /* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not
1525 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1526 platforms by defining GNULIB_NAMESPACE::lseek always. */
1527 # if defined _WIN32 && !defined __CYGWIN__
1528 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1529 # undef lseek
1530 # define lseek _lseek
1531 # endif
1532 _GL_CXXALIAS_MDA (lseek, long, (int fd, long offset, int whence));
1533 # else
1534 _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
1535 # endif
1536 _GL_CXXALIASWARN (lseek);
1537 #endif
1540 #if @GNULIB_PIPE@
1541 /* Create a pipe, defaulting to O_BINARY mode.
1542 Store the read-end as fd[0] and the write-end as fd[1].
1543 Return 0 upon success, or -1 with errno set upon failure. */
1544 # if !@HAVE_PIPE@
1545 _GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
1546 # endif
1547 _GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
1548 _GL_CXXALIASWARN (pipe);
1549 #elif defined GNULIB_POSIXCHECK
1550 # undef pipe
1551 # if HAVE_RAW_DECL_PIPE
1552 _GL_WARN_ON_USE (pipe, "pipe is unportable - "
1553 "use gnulib module pipe-posix for portability");
1554 # endif
1555 #endif
1558 #if @GNULIB_PIPE2@
1559 /* Create a pipe, applying the given flags when opening the read-end of the
1560 pipe and the write-end of the pipe.
1561 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
1562 and O_TEXT, O_BINARY (defined in "binary-io.h").
1563 Store the read-end as fd[0] and the write-end as fd[1].
1564 Return 0 upon success, or -1 with errno set upon failure.
1565 See also the Linux man page at
1566 <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
1567 # if @HAVE_PIPE2@
1568 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1569 # define pipe2 rpl_pipe2
1570 # endif
1571 _GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
1572 _GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
1573 # else
1574 _GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
1575 _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
1576 # endif
1577 _GL_CXXALIASWARN (pipe2);
1578 #elif defined GNULIB_POSIXCHECK
1579 # undef pipe2
1580 # if HAVE_RAW_DECL_PIPE2
1581 _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
1582 "use gnulib module pipe2 for portability");
1583 # endif
1584 #endif
1587 #if @GNULIB_PREAD@
1588 /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
1589 Return the number of bytes placed into BUF if successful, otherwise
1590 set errno and return -1. 0 indicates EOF.
1591 See the POSIX:2008 specification
1592 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */
1593 # if @REPLACE_PREAD@
1594 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1595 # undef pread
1596 # define pread rpl_pread
1597 # endif
1598 _GL_FUNCDECL_RPL (pread, ssize_t,
1599 (int fd, void *buf, size_t bufsize, off_t offset)
1600 _GL_ARG_NONNULL ((2)));
1601 _GL_CXXALIAS_RPL (pread, ssize_t,
1602 (int fd, void *buf, size_t bufsize, off_t offset));
1603 # else
1604 # if !@HAVE_PREAD@
1605 _GL_FUNCDECL_SYS (pread, ssize_t,
1606 (int fd, void *buf, size_t bufsize, off_t offset)
1607 _GL_ARG_NONNULL ((2)));
1608 # endif
1609 _GL_CXXALIAS_SYS (pread, ssize_t,
1610 (int fd, void *buf, size_t bufsize, off_t offset));
1611 # endif
1612 _GL_CXXALIASWARN (pread);
1613 #elif defined GNULIB_POSIXCHECK
1614 # undef pread
1615 # if HAVE_RAW_DECL_PREAD
1616 _GL_WARN_ON_USE (pread, "pread is unportable - "
1617 "use gnulib module pread for portability");
1618 # endif
1619 #endif
1622 #if @GNULIB_PWRITE@
1623 /* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
1624 Return the number of bytes written if successful, otherwise
1625 set errno and return -1. 0 indicates nothing written. See the
1626 POSIX:2008 specification
1627 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */
1628 # if @REPLACE_PWRITE@
1629 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1630 # undef pwrite
1631 # define pwrite rpl_pwrite
1632 # endif
1633 _GL_FUNCDECL_RPL (pwrite, ssize_t,
1634 (int fd, const void *buf, size_t bufsize, off_t offset)
1635 _GL_ARG_NONNULL ((2)));
1636 _GL_CXXALIAS_RPL (pwrite, ssize_t,
1637 (int fd, const void *buf, size_t bufsize, off_t offset));
1638 # else
1639 # if !@HAVE_PWRITE@
1640 _GL_FUNCDECL_SYS (pwrite, ssize_t,
1641 (int fd, const void *buf, size_t bufsize, off_t offset)
1642 _GL_ARG_NONNULL ((2)));
1643 # endif
1644 _GL_CXXALIAS_SYS (pwrite, ssize_t,
1645 (int fd, const void *buf, size_t bufsize, off_t offset));
1646 # endif
1647 _GL_CXXALIASWARN (pwrite);
1648 #elif defined GNULIB_POSIXCHECK
1649 # undef pwrite
1650 # if HAVE_RAW_DECL_PWRITE
1651 _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
1652 "use gnulib module pwrite for portability");
1653 # endif
1654 #endif
1657 #if @GNULIB_READ@
1658 /* Read up to COUNT bytes from file descriptor FD into the buffer starting
1659 at BUF. See the POSIX:2008 specification
1660 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */
1661 # if @REPLACE_READ@
1662 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1663 # undef read
1664 # define read rpl_read
1665 # endif
1666 _GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
1667 _GL_ARG_NONNULL ((2)));
1668 _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
1669 # elif defined _WIN32 && !defined __CYGWIN__
1670 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1671 # undef read
1672 # define read _read
1673 # endif
1674 _GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count));
1675 # else
1676 _GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
1677 # endif
1678 _GL_CXXALIASWARN (read);
1679 #else
1680 /* On native Windows, map 'read' to '_read', so that -loldnames is not
1681 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1682 platforms by defining GNULIB_NAMESPACE::read always. */
1683 # if defined _WIN32 && !defined __CYGWIN__
1684 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1685 # undef read
1686 # define read _read
1687 # endif
1688 # ifdef __MINGW32__
1689 _GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count));
1690 # else
1691 _GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count));
1692 # endif
1693 # else
1694 _GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
1695 # endif
1696 _GL_CXXALIASWARN (read);
1697 #endif
1700 #if @GNULIB_READLINK@
1701 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
1702 bytes of it into BUF. Return the number of bytes placed into BUF if
1703 successful, otherwise -1 and errno set.
1704 See the POSIX:2008 specification
1705 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */
1706 # if @REPLACE_READLINK@
1707 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1708 # define readlink rpl_readlink
1709 # endif
1710 _GL_FUNCDECL_RPL (readlink, ssize_t,
1711 (const char *restrict file,
1712 char *restrict buf, size_t bufsize)
1713 _GL_ARG_NONNULL ((1, 2)));
1714 _GL_CXXALIAS_RPL (readlink, ssize_t,
1715 (const char *restrict file,
1716 char *restrict buf, size_t bufsize));
1717 # else
1718 # if !@HAVE_READLINK@
1719 _GL_FUNCDECL_SYS (readlink, ssize_t,
1720 (const char *restrict file,
1721 char *restrict buf, size_t bufsize)
1722 _GL_ARG_NONNULL ((1, 2)));
1723 # endif
1724 _GL_CXXALIAS_SYS (readlink, ssize_t,
1725 (const char *restrict file,
1726 char *restrict buf, size_t bufsize));
1727 # endif
1728 _GL_CXXALIASWARN (readlink);
1729 #elif defined GNULIB_POSIXCHECK
1730 # undef readlink
1731 # if HAVE_RAW_DECL_READLINK
1732 _GL_WARN_ON_USE (readlink, "readlink is unportable - "
1733 "use gnulib module readlink for portability");
1734 # endif
1735 #endif
1738 #if @GNULIB_READLINKAT@
1739 # if @REPLACE_READLINKAT@
1740 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1741 # define readlinkat rpl_readlinkat
1742 # endif
1743 _GL_FUNCDECL_RPL (readlinkat, ssize_t,
1744 (int fd, char const *restrict file,
1745 char *restrict buf, size_t len)
1746 _GL_ARG_NONNULL ((2, 3)));
1747 _GL_CXXALIAS_RPL (readlinkat, ssize_t,
1748 (int fd, char const *restrict file,
1749 char *restrict buf, size_t len));
1750 # else
1751 # if !@HAVE_READLINKAT@
1752 _GL_FUNCDECL_SYS (readlinkat, ssize_t,
1753 (int fd, char const *restrict file,
1754 char *restrict buf, size_t len)
1755 _GL_ARG_NONNULL ((2, 3)));
1756 # endif
1757 _GL_CXXALIAS_SYS (readlinkat, ssize_t,
1758 (int fd, char const *restrict file,
1759 char *restrict buf, size_t len));
1760 # endif
1761 _GL_CXXALIASWARN (readlinkat);
1762 #elif defined GNULIB_POSIXCHECK
1763 # undef readlinkat
1764 # if HAVE_RAW_DECL_READLINKAT
1765 _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
1766 "use gnulib module readlinkat for portability");
1767 # endif
1768 #endif
1771 #if @GNULIB_RMDIR@
1772 /* Remove the directory DIR. */
1773 # if @REPLACE_RMDIR@
1774 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1775 # define rmdir rpl_rmdir
1776 # endif
1777 _GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
1778 _GL_CXXALIAS_RPL (rmdir, int, (char const *name));
1779 # elif defined _WIN32 && !defined __CYGWIN__
1780 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1781 # undef rmdir
1782 # define rmdir _rmdir
1783 # endif
1784 _GL_CXXALIAS_MDA (rmdir, int, (char const *name));
1785 # else
1786 _GL_CXXALIAS_SYS (rmdir, int, (char const *name));
1787 # endif
1788 _GL_CXXALIASWARN (rmdir);
1789 #elif defined GNULIB_POSIXCHECK
1790 # undef rmdir
1791 # if HAVE_RAW_DECL_RMDIR
1792 _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
1793 "use gnulib module rmdir for portability");
1794 # endif
1795 #else
1796 /* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not
1797 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1798 platforms by defining GNULIB_NAMESPACE::rmdir always. */
1799 # if defined _WIN32 && !defined __CYGWIN__
1800 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1801 # undef rmdir
1802 # define rmdir _rmdir
1803 # endif
1804 _GL_CXXALIAS_MDA (rmdir, int, (char const *name));
1805 # else
1806 _GL_CXXALIAS_SYS (rmdir, int, (char const *name));
1807 # endif
1808 _GL_CXXALIASWARN (rmdir);
1809 #endif
1812 #if @GNULIB_SETHOSTNAME@
1813 /* Set the host name of the machine.
1814 The host name may or may not be fully qualified.
1816 Put LEN bytes of NAME into the host name.
1817 Return 0 if successful, otherwise, set errno and return -1.
1819 Platforms with no ability to set the hostname return -1 and set
1820 errno = ENOSYS. */
1821 # if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
1822 _GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
1823 _GL_ARG_NONNULL ((1)));
1824 # endif
1825 /* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
1826 and FreeBSD 6.4 the second parameter is int. On Solaris 11
1827 2011-10, the first parameter is not const. */
1828 _GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
1829 _GL_CXXALIASWARN (sethostname);
1830 #elif defined GNULIB_POSIXCHECK
1831 # undef sethostname
1832 # if HAVE_RAW_DECL_SETHOSTNAME
1833 _GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
1834 "use gnulib module sethostname for portability");
1835 # endif
1836 #endif
1839 #if @GNULIB_SLEEP@
1840 /* Pause the execution of the current thread for N seconds.
1841 Returns the number of seconds left to sleep.
1842 See the POSIX:2008 specification
1843 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */
1844 # if @REPLACE_SLEEP@
1845 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1846 # undef sleep
1847 # define sleep rpl_sleep
1848 # endif
1849 _GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
1850 _GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
1851 # else
1852 # if !@HAVE_SLEEP@
1853 _GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
1854 # endif
1855 _GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
1856 # endif
1857 _GL_CXXALIASWARN (sleep);
1858 #elif defined GNULIB_POSIXCHECK
1859 # undef sleep
1860 # if HAVE_RAW_DECL_SLEEP
1861 _GL_WARN_ON_USE (sleep, "sleep is unportable - "
1862 "use gnulib module sleep for portability");
1863 # endif
1864 #endif
1867 /* On native Windows, map 'swab' to '_swab', so that -loldnames is not
1868 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1869 platforms by defining GNULIB_NAMESPACE::creat always. */
1870 #if defined _WIN32 && !defined __CYGWIN__
1871 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1872 # undef swab
1873 # define swab _swab
1874 # endif
1875 _GL_CXXALIAS_MDA (swab, void, (char *from, char *to, int n));
1876 #else
1877 _GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));
1878 #endif
1879 _GL_CXXALIASWARN (swab);
1882 #if @GNULIB_SYMLINK@
1883 # if @REPLACE_SYMLINK@
1884 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1885 # undef symlink
1886 # define symlink rpl_symlink
1887 # endif
1888 _GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
1889 _GL_ARG_NONNULL ((1, 2)));
1890 _GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
1891 # else
1892 # if !@HAVE_SYMLINK@
1893 _GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
1894 _GL_ARG_NONNULL ((1, 2)));
1895 # endif
1896 _GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
1897 # endif
1898 _GL_CXXALIASWARN (symlink);
1899 #elif defined GNULIB_POSIXCHECK
1900 # undef symlink
1901 # if HAVE_RAW_DECL_SYMLINK
1902 _GL_WARN_ON_USE (symlink, "symlink is not portable - "
1903 "use gnulib module symlink for portability");
1904 # endif
1905 #endif
1908 #if @GNULIB_SYMLINKAT@
1909 # if @REPLACE_SYMLINKAT@
1910 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1911 # undef symlinkat
1912 # define symlinkat rpl_symlinkat
1913 # endif
1914 _GL_FUNCDECL_RPL (symlinkat, int,
1915 (char const *contents, int fd, char const *file)
1916 _GL_ARG_NONNULL ((1, 3)));
1917 _GL_CXXALIAS_RPL (symlinkat, int,
1918 (char const *contents, int fd, char const *file));
1919 # else
1920 # if !@HAVE_SYMLINKAT@
1921 _GL_FUNCDECL_SYS (symlinkat, int,
1922 (char const *contents, int fd, char const *file)
1923 _GL_ARG_NONNULL ((1, 3)));
1924 # endif
1925 _GL_CXXALIAS_SYS (symlinkat, int,
1926 (char const *contents, int fd, char const *file));
1927 # endif
1928 _GL_CXXALIASWARN (symlinkat);
1929 #elif defined GNULIB_POSIXCHECK
1930 # undef symlinkat
1931 # if HAVE_RAW_DECL_SYMLINKAT
1932 _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
1933 "use gnulib module symlinkat for portability");
1934 # endif
1935 #endif
1938 #if @GNULIB_TRUNCATE@
1939 /* Change the size of the file designated by FILENAME to become equal to LENGTH.
1940 Return 0 if successful, otherwise -1 and errno set.
1941 See the POSIX:2008 specification
1942 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>. */
1943 # if @REPLACE_TRUNCATE@
1944 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1945 # undef truncate
1946 # define truncate rpl_truncate
1947 # endif
1948 _GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
1949 _GL_ARG_NONNULL ((1)));
1950 _GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
1951 # else
1952 # if !@HAVE_DECL_TRUNCATE@
1953 _GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
1954 _GL_ARG_NONNULL ((1)));
1955 # endif
1956 _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
1957 # endif
1958 _GL_CXXALIASWARN (truncate);
1959 #elif defined GNULIB_POSIXCHECK
1960 # undef truncate
1961 # if HAVE_RAW_DECL_TRUNCATE
1962 _GL_WARN_ON_USE (truncate, "truncate is unportable - "
1963 "use gnulib module truncate for portability");
1964 # endif
1965 #endif
1968 #if @GNULIB_TTYNAME_R@
1969 /* Store at most BUFLEN characters of the pathname of the terminal FD is
1970 open on in BUF. Return 0 on success, otherwise an error number. */
1971 # if @REPLACE_TTYNAME_R@
1972 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1973 # undef ttyname_r
1974 # define ttyname_r rpl_ttyname_r
1975 # endif
1976 _GL_FUNCDECL_RPL (ttyname_r, int,
1977 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
1978 _GL_CXXALIAS_RPL (ttyname_r, int,
1979 (int fd, char *buf, size_t buflen));
1980 # else
1981 # if !@HAVE_DECL_TTYNAME_R@
1982 _GL_FUNCDECL_SYS (ttyname_r, int,
1983 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
1984 # endif
1985 _GL_CXXALIAS_SYS (ttyname_r, int,
1986 (int fd, char *buf, size_t buflen));
1987 # endif
1988 _GL_CXXALIASWARN (ttyname_r);
1989 #elif defined GNULIB_POSIXCHECK
1990 # undef ttyname_r
1991 # if HAVE_RAW_DECL_TTYNAME_R
1992 _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
1993 "use gnulib module ttyname_r for portability");
1994 # endif
1995 #endif
1998 #if @GNULIB_UNLINK@
1999 # if @REPLACE_UNLINK@
2000 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2001 # undef unlink
2002 # define unlink rpl_unlink
2003 # endif
2004 _GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
2005 _GL_CXXALIAS_RPL (unlink, int, (char const *file));
2006 # elif defined _WIN32 && !defined __CYGWIN__
2007 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2008 # undef unlink
2009 # define unlink _unlink
2010 # endif
2011 _GL_CXXALIAS_MDA (unlink, int, (char const *file));
2012 # else
2013 _GL_CXXALIAS_SYS (unlink, int, (char const *file));
2014 # endif
2015 _GL_CXXALIASWARN (unlink);
2016 #elif defined GNULIB_POSIXCHECK
2017 # undef unlink
2018 # if HAVE_RAW_DECL_UNLINK
2019 _GL_WARN_ON_USE (unlink, "unlink is not portable - "
2020 "use gnulib module unlink for portability");
2021 # endif
2022 #else
2023 /* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not
2024 required. In C++ with GNULIB_NAMESPACE, avoid differences between
2025 platforms by defining GNULIB_NAMESPACE::unlink always. */
2026 # if defined _WIN32 && !defined __CYGWIN__
2027 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2028 # undef unlink
2029 # define unlink _unlink
2030 # endif
2031 _GL_CXXALIAS_MDA (unlink, int, (char const *file));
2032 # else
2033 _GL_CXXALIAS_SYS (unlink, int, (char const *file));
2034 # endif
2035 _GL_CXXALIASWARN (unlink);
2036 #endif
2039 #if @GNULIB_UNLINKAT@
2040 # if @REPLACE_UNLINKAT@
2041 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2042 # undef unlinkat
2043 # define unlinkat rpl_unlinkat
2044 # endif
2045 _GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
2046 _GL_ARG_NONNULL ((2)));
2047 _GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
2048 # else
2049 # if !@HAVE_UNLINKAT@
2050 _GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
2051 _GL_ARG_NONNULL ((2)));
2052 # endif
2053 _GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
2054 # endif
2055 _GL_CXXALIASWARN (unlinkat);
2056 #elif defined GNULIB_POSIXCHECK
2057 # undef unlinkat
2058 # if HAVE_RAW_DECL_UNLINKAT
2059 _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
2060 "use gnulib module openat for portability");
2061 # endif
2062 #endif
2065 #if @GNULIB_USLEEP@
2066 /* Pause the execution of the current thread for N microseconds.
2067 Returns 0 on completion, or -1 on range error.
2068 See the POSIX:2001 specification
2069 <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>. */
2070 # if @REPLACE_USLEEP@
2071 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2072 # undef usleep
2073 # define usleep rpl_usleep
2074 # endif
2075 _GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
2076 _GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
2077 # else
2078 # if !@HAVE_USLEEP@
2079 _GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
2080 # endif
2081 /* Need to cast, because on Haiku, the first parameter is
2082 unsigned int n. */
2083 _GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n));
2084 # endif
2085 _GL_CXXALIASWARN (usleep);
2086 #elif defined GNULIB_POSIXCHECK
2087 # undef usleep
2088 # if HAVE_RAW_DECL_USLEEP
2089 _GL_WARN_ON_USE (usleep, "usleep is unportable - "
2090 "use gnulib module usleep for portability");
2091 # endif
2092 #endif
2095 #if @GNULIB_WRITE@
2096 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
2097 See the POSIX:2008 specification
2098 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */
2099 # if @REPLACE_WRITE@
2100 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2101 # undef write
2102 # define write rpl_write
2103 # endif
2104 _GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
2105 _GL_ARG_NONNULL ((2)));
2106 _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
2107 # elif defined _WIN32 && !defined __CYGWIN__
2108 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2109 # undef write
2110 # define write _write
2111 # endif
2112 _GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count));
2113 # else
2114 _GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
2115 # endif
2116 _GL_CXXALIASWARN (write);
2117 #else
2118 /* On native Windows, map 'write' to '_write', so that -loldnames is not
2119 required. In C++ with GNULIB_NAMESPACE, avoid differences between
2120 platforms by defining GNULIB_NAMESPACE::write always. */
2121 # if defined _WIN32 && !defined __CYGWIN__
2122 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2123 # undef write
2124 # define write _write
2125 # endif
2126 # ifdef __MINGW32__
2127 _GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count));
2128 # else
2129 _GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count));
2130 # endif
2131 # else
2132 _GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
2133 # endif
2134 _GL_CXXALIASWARN (write);
2135 #endif
2137 _GL_INLINE_HEADER_END
2139 #endif /* _@GUARD_PREFIX@_UNISTD_H */
2140 #endif /* _GL_INCLUDING_UNISTD_H */
2141 #endif /* _@GUARD_PREFIX@_UNISTD_H */