1 /* Substitute for and wrapper around <unistd.h>.
2 Copyright (C) 2003-2024 Free Software Foundation, Inc.
4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of the
7 License, or (at your option) any later version.
9 This file 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 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17 #ifndef _@GUARD_PREFIX@_UNISTD_H
20 @PRAGMA_SYSTEM_HEADER@
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@
34 /* Normal invocation convention. */
36 /* The include_next requires a split double-inclusion guard. */
38 # define _GL_INCLUDING_UNISTD_H
39 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
40 # undef _GL_INCLUDING_UNISTD_H
43 /* Avoid lseek bugs in FreeBSD, macOS <https://bugs.gnu.org/61386>.
44 This bug is fixed after FreeBSD 13; see <https://bugs.freebsd.org/256205>.
45 Use macOS "9999" to stand for a future fixed macOS version. */
46 #if defined __FreeBSD__ && __FreeBSD__ < 14
49 #elif defined __APPLE__ && defined __MACH__ && defined SEEK_DATA
50 # ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
51 # include <AvailabilityMacros.h>
53 # if (!defined MAC_OS_X_VERSION_MIN_REQUIRED \
54 || MAC_OS_X_VERSION_MIN_REQUIRED < 99990000)
55 # include <sys/fcntl.h> /* It also defines the two macros. */
61 /* Get all possible declarations of gethostname(). */
62 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
63 && !defined _GL_INCLUDING_WINSOCK2_H
64 # define _GL_INCLUDING_WINSOCK2_H
65 # include <winsock2.h>
66 # undef _GL_INCLUDING_WINSOCK2_H
69 #if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
70 #define _@GUARD_PREFIX@_UNISTD_H
72 /* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK,
74 #if !_GL_CONFIG_H_INCLUDED
75 #error "Please include config.h first."
78 /* NetBSD 5.0 mis-defines NULL. Also get size_t. */
79 /* But avoid namespace pollution on glibc systems. */
84 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
85 /* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include
86 it before we #define unlink rpl_unlink. */
87 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */
88 /* But avoid namespace pollution on glibc systems. */
89 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
90 || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
91 && (defined _WIN32 && ! defined __CYGWIN__)) \
92 || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
93 && defined __CYGWIN__)) \
94 && ! defined __GLIBC__
98 /* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in
100 /* But avoid namespace pollution on glibc systems. */
101 #if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \
102 && (defined __CYGWIN__ || defined __ANDROID__) \
103 && ! defined __GLIBC__
107 /* mingw fails to declare _exit in <unistd.h>. */
108 /* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
110 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */
111 /* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is
113 /* But avoid namespace pollution on glibc systems. */
114 #if !defined __GLIBC__ && !defined __osf__
115 # define __need_system_stdlib_h
117 # undef __need_system_stdlib_h
120 /* Native Windows platforms declare _chdir, _getcwd, _rmdir in
121 <io.h> and/or <direct.h>, not in <unistd.h>.
122 They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(),
123 _lseek(), _read(), _unlink(), _write() in <io.h>. */
124 #if defined _WIN32 && !defined __CYGWIN__
129 /* Native Windows platforms declare _execl*, _execv* in <process.h>. */
130 #if defined _WIN32 && !defined __CYGWIN__
131 # include <process.h>
134 /* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
135 NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */
136 /* But avoid namespace pollution on glibc systems. */
137 #if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
138 || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
139 && !defined __GLIBC__
143 /* Mac OS X 10.13, Solaris 11.4, and Android 9.0 declare getentropy in
144 <sys/random.h>, not in <unistd.h>. */
145 /* But avoid namespace pollution on glibc systems. */
146 #if (@GNULIB_GETENTROPY@ || defined GNULIB_POSIXCHECK) \
147 && ((defined __APPLE__ && defined __MACH__) || defined __sun \
148 || defined __ANDROID__) \
149 && @UNISTD_H_HAVE_SYS_RANDOM_H@ \
150 && !defined __GLIBC__
151 # include <sys/random.h>
154 /* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>. */
155 /* But avoid namespace pollution on glibc systems. */
156 #if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
157 && !defined __GLIBC__
158 # include <sys/stat.h>
161 /* MSVC defines off_t in <sys/types.h>.
162 May also define off_t to a 64-bit type on native Windows. */
163 /* Get off_t, ssize_t, mode_t. */
164 #include <sys/types.h>
166 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
168 /* The definition of _GL_ARG_NONNULL is copied here. */
170 /* The definition of _GL_WARN_ON_USE is copied here. */
173 /* Get getopt(), optarg, optind, opterr, optopt. */
174 #if @GNULIB_GETOPT_POSIX@ && @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
175 # include <getopt-cdefs.h>
176 # include <getopt-pfx-core.h>
179 _GL_INLINE_HEADER_BEGIN
180 #ifndef _GL_UNISTD_INLINE
181 # define _GL_UNISTD_INLINE _GL_INLINE
184 /* Hide some function declarations from <winsock2.h>. */
186 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
187 # if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
188 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
190 # define socket socket_used_without_including_sys_socket_h
192 # define connect connect_used_without_including_sys_socket_h
194 # define accept accept_used_without_including_sys_socket_h
196 # define bind bind_used_without_including_sys_socket_h
198 # define getpeername getpeername_used_without_including_sys_socket_h
200 # define getsockname getsockname_used_without_including_sys_socket_h
202 # define getsockopt getsockopt_used_without_including_sys_socket_h
204 # define listen listen_used_without_including_sys_socket_h
206 # define recv recv_used_without_including_sys_socket_h
208 # define send send_used_without_including_sys_socket_h
210 # define recvfrom recvfrom_used_without_including_sys_socket_h
212 # define sendto sendto_used_without_including_sys_socket_h
214 # define setsockopt setsockopt_used_without_including_sys_socket_h
216 # define shutdown shutdown_used_without_including_sys_socket_h
218 _GL_WARN_ON_USE (socket
,
219 "socket() used without including <sys/socket.h>");
220 _GL_WARN_ON_USE (connect
,
221 "connect() used without including <sys/socket.h>");
222 _GL_WARN_ON_USE (accept
,
223 "accept() used without including <sys/socket.h>");
224 _GL_WARN_ON_USE (bind
,
225 "bind() used without including <sys/socket.h>");
226 _GL_WARN_ON_USE (getpeername
,
227 "getpeername() used without including <sys/socket.h>");
228 _GL_WARN_ON_USE (getsockname
,
229 "getsockname() used without including <sys/socket.h>");
230 _GL_WARN_ON_USE (getsockopt
,
231 "getsockopt() used without including <sys/socket.h>");
232 _GL_WARN_ON_USE (listen
,
233 "listen() used without including <sys/socket.h>");
234 _GL_WARN_ON_USE (recv
,
235 "recv() used without including <sys/socket.h>");
236 _GL_WARN_ON_USE (send
,
237 "send() used without including <sys/socket.h>");
238 _GL_WARN_ON_USE (recvfrom
,
239 "recvfrom() used without including <sys/socket.h>");
240 _GL_WARN_ON_USE (sendto
,
241 "sendto() used without including <sys/socket.h>");
242 _GL_WARN_ON_USE (setsockopt
,
243 "setsockopt() used without including <sys/socket.h>");
244 _GL_WARN_ON_USE (shutdown
,
245 "shutdown() used without including <sys/socket.h>");
248 # if !defined _@GUARD_PREFIX@_SYS_SELECT_H
249 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
251 # define select select_used_without_including_sys_select_h
253 _GL_WARN_ON_USE (select
,
254 "select() used without including <sys/select.h>");
260 /* OS/2 EMX lacks these macros. */
262 # define STDIN_FILENO 0
264 #ifndef STDOUT_FILENO
265 # define STDOUT_FILENO 1
267 #ifndef STDERR_FILENO
268 # define STDERR_FILENO 2
271 /* Ensure *_OK macros exist. */
280 /* Declare overridden functions. */
284 # if @REPLACE_ACCESS@
285 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
287 # define access rpl_access
289 _GL_FUNCDECL_RPL (access
, int, (const char *file
, int mode
)
290 _GL_ARG_NONNULL ((1)));
291 _GL_CXXALIAS_RPL (access
, int, (const char *file
, int mode
));
292 # elif defined _WIN32 && !defined __CYGWIN__
293 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
295 # define access _access
297 _GL_CXXALIAS_MDA (access
, int, (const char *file
, int mode
));
299 _GL_CXXALIAS_SYS (access
, int, (const char *file
, int mode
));
301 _GL_CXXALIASWARN (access
);
302 #elif defined GNULIB_POSIXCHECK
304 # if HAVE_RAW_DECL_ACCESS
305 /* The access() function is a security risk. */
306 _GL_WARN_ON_USE (access
, "access does not always support X_OK - "
307 "use gnulib module access for portability; "
308 "also, this function is a security risk - "
309 "use the gnulib module faccessat instead");
311 #elif @GNULIB_MDA_ACCESS@
312 /* On native Windows, map 'access' to '_access', so that -loldnames is not
313 required. In C++ with GNULIB_NAMESPACE, avoid differences between
314 platforms by defining GNULIB_NAMESPACE::access always. */
315 # if defined _WIN32 && !defined __CYGWIN__
316 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
318 # define access _access
320 _GL_CXXALIAS_MDA (access
, int, (const char *file
, int mode
));
322 _GL_CXXALIAS_SYS (access
, int, (const char *file
, int mode
));
324 _GL_CXXALIASWARN (access
);
329 # if defined _WIN32 && !defined __CYGWIN__
330 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
332 # define chdir _chdir
334 _GL_CXXALIAS_MDA (chdir
, int, (const char *file
));
336 _GL_CXXALIAS_SYS (chdir
, int, (const char *file
) _GL_ARG_NONNULL ((1)));
338 _GL_CXXALIASWARN (chdir
);
339 #elif defined GNULIB_POSIXCHECK
341 # if HAVE_RAW_DECL_CHDIR
342 _GL_WARN_ON_USE (chown
, "chdir is not always in <unistd.h> - "
343 "use gnulib module chdir for portability");
345 #elif @GNULIB_MDA_CHDIR@
346 /* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not
347 required. In C++ with GNULIB_NAMESPACE, avoid differences between
348 platforms by defining GNULIB_NAMESPACE::chdir always. */
349 # if defined _WIN32 && !defined __CYGWIN__
350 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
352 # define chdir _chdir
354 _GL_CXXALIAS_MDA (chdir
, int, (const char *file
));
356 _GL_CXXALIAS_SYS (chdir
, int, (const char *file
) _GL_ARG_NONNULL ((1)));
358 _GL_CXXALIASWARN (chdir
);
363 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
364 to GID (if GID is not -1). Follow symbolic links.
365 Return 0 if successful, otherwise -1 and errno set.
366 See the POSIX:2008 specification
367 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */
369 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
371 # define chown rpl_chown
373 _GL_FUNCDECL_RPL (chown
, int, (const char *file
, uid_t uid
, gid_t gid
)
374 _GL_ARG_NONNULL ((1)));
375 _GL_CXXALIAS_RPL (chown
, int, (const char *file
, uid_t uid
, gid_t gid
));
378 _GL_FUNCDECL_SYS (chown
, int, (const char *file
, uid_t uid
, gid_t gid
)
379 _GL_ARG_NONNULL ((1)));
381 _GL_CXXALIAS_SYS (chown
, int, (const char *file
, uid_t uid
, gid_t gid
));
383 _GL_CXXALIASWARN (chown
);
384 #elif defined GNULIB_POSIXCHECK
386 # if HAVE_RAW_DECL_CHOWN
387 _GL_WARN_ON_USE (chown
, "chown fails to follow symlinks on some systems and "
388 "doesn't treat a uid or gid of -1 on some systems - "
389 "use gnulib module chown for portability");
396 /* Automatically included by modules that need a replacement for close. */
397 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
399 # define close rpl_close
401 _GL_FUNCDECL_RPL (close
, int, (int fd
));
402 _GL_CXXALIAS_RPL (close
, int, (int fd
));
403 # elif defined _WIN32 && !defined __CYGWIN__
404 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
406 # define close _close
408 _GL_CXXALIAS_MDA (close
, int, (int fd
));
410 _GL_CXXALIAS_SYS (close
, int, (int fd
));
412 _GL_CXXALIASWARN (close
);
413 #elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
415 # define close close_used_without_requesting_gnulib_module_close
416 #elif defined GNULIB_POSIXCHECK
418 /* Assume close is always declared. */
419 _GL_WARN_ON_USE (close
, "close does not portably work on sockets - "
420 "use gnulib module close for portability");
421 #elif @GNULIB_MDA_CLOSE@
422 /* On native Windows, map 'close' to '_close', so that -loldnames is not
423 required. In C++ with GNULIB_NAMESPACE, avoid differences between
424 platforms by defining GNULIB_NAMESPACE::close always. */
425 # if defined _WIN32 && !defined __CYGWIN__
426 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
428 # define close _close
430 _GL_CXXALIAS_MDA (close
, int, (int fd
));
432 _GL_CXXALIAS_SYS (close
, int, (int fd
));
434 _GL_CXXALIASWARN (close
);
438 #if @GNULIB_COPY_FILE_RANGE@
439 # if @REPLACE_COPY_FILE_RANGE@
440 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
441 # undef copy_file_range
442 # define copy_file_range rpl_copy_file_range
444 _GL_FUNCDECL_RPL (copy_file_range
, ssize_t
, (int ifd
, off_t
*ipos
,
445 int ofd
, off_t
*opos
,
446 size_t len
, unsigned flags
));
447 _GL_CXXALIAS_RPL (copy_file_range
, ssize_t
, (int ifd
, off_t
*ipos
,
448 int ofd
, off_t
*opos
,
449 size_t len
, unsigned flags
));
451 # if !@HAVE_COPY_FILE_RANGE@
452 _GL_FUNCDECL_SYS (copy_file_range
, ssize_t
, (int ifd
, off_t
*ipos
,
453 int ofd
, off_t
*opos
,
454 size_t len
, unsigned flags
));
456 _GL_CXXALIAS_SYS (copy_file_range
, ssize_t
, (int ifd
, off_t
*ipos
,
457 int ofd
, off_t
*opos
,
458 size_t len
, unsigned flags
));
460 _GL_CXXALIASWARN (copy_file_range
);
461 #elif defined GNULIB_POSIXCHECK
462 # undef copy_file_range
463 # if HAVE_RAW_DECL_COPY_FILE_RANGE
464 _GL_WARN_ON_USE (copy_file_range
,
465 "copy_file_range is unportable - "
466 "use gnulib module copy_file_range for portability");
473 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
476 _GL_FUNCDECL_RPL (dup
, int, (int oldfd
));
477 _GL_CXXALIAS_RPL (dup
, int, (int oldfd
));
478 # elif defined _WIN32 && !defined __CYGWIN__
479 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
483 _GL_CXXALIAS_MDA (dup
, int, (int oldfd
));
485 _GL_CXXALIAS_SYS (dup
, int, (int oldfd
));
487 _GL_CXXALIASWARN (dup
);
488 #elif defined GNULIB_POSIXCHECK
490 # if HAVE_RAW_DECL_DUP
491 _GL_WARN_ON_USE (dup
, "dup is unportable - "
492 "use gnulib module dup for portability");
494 #elif @GNULIB_MDA_DUP@
495 /* On native Windows, map 'dup' to '_dup', so that -loldnames is not
496 required. In C++ with GNULIB_NAMESPACE, avoid differences between
497 platforms by defining GNULIB_NAMESPACE::dup always. */
498 # if defined _WIN32 && !defined __CYGWIN__
499 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
503 _GL_CXXALIAS_MDA (dup
, int, (int oldfd
));
505 _GL_CXXALIAS_SYS (dup
, int, (int oldfd
));
507 _GL_CXXALIASWARN (dup
);
512 /* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
513 NEWFD = OLDFD, otherwise close NEWFD first if it is open.
514 Return newfd if successful, otherwise -1 and errno set.
515 See the POSIX:2008 specification
516 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */
518 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
519 # define dup2 rpl_dup2
521 _GL_FUNCDECL_RPL (dup2
, int, (int oldfd
, int newfd
));
522 _GL_CXXALIAS_RPL (dup2
, int, (int oldfd
, int newfd
));
523 # elif defined _WIN32 && !defined __CYGWIN__
524 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
528 _GL_CXXALIAS_MDA (dup2
, int, (int oldfd
, int newfd
));
530 _GL_CXXALIAS_SYS (dup2
, int, (int oldfd
, int newfd
));
532 _GL_CXXALIASWARN (dup2
);
533 #elif defined GNULIB_POSIXCHECK
535 # if HAVE_RAW_DECL_DUP2
536 _GL_WARN_ON_USE (dup2
, "dup2 is unportable - "
537 "use gnulib module dup2 for portability");
539 #elif @GNULIB_MDA_DUP2@
540 /* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not
541 required. In C++ with GNULIB_NAMESPACE, avoid differences between
542 platforms by defining GNULIB_NAMESPACE::dup2 always. */
543 # if defined _WIN32 && !defined __CYGWIN__
544 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
548 _GL_CXXALIAS_MDA (dup2
, int, (int oldfd
, int newfd
));
550 _GL_CXXALIAS_SYS (dup2
, int, (int oldfd
, int newfd
));
552 _GL_CXXALIASWARN (dup2
);
557 /* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
559 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
560 and O_TEXT, O_BINARY (defined in "binary-io.h").
561 Close NEWFD first if it is open.
562 Return newfd if successful, otherwise -1 and errno set.
563 See the Linux man page at
564 <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
566 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
568 # define dup3 rpl_dup3
570 _GL_FUNCDECL_RPL (dup3
, int, (int oldfd
, int newfd
, int flags
));
571 _GL_CXXALIAS_RPL (dup3
, int, (int oldfd
, int newfd
, int flags
));
574 _GL_FUNCDECL_SYS (dup3
, int, (int oldfd
, int newfd
, int flags
));
576 _GL_CXXALIAS_SYS (dup3
, int, (int oldfd
, int newfd
, int flags
));
579 _GL_CXXALIASWARN (dup3
);
581 #elif defined GNULIB_POSIXCHECK
583 # if HAVE_RAW_DECL_DUP3
584 _GL_WARN_ON_USE (dup3
, "dup3 is unportable - "
585 "use gnulib module dup3 for portability");
591 # if defined __CYGWIN__ && !defined __i386__
592 /* The 'environ' variable is defined in a DLL. Therefore its declaration needs
593 the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it.
594 This leads to a link error on 64-bit Cygwin when the option
595 -Wl,--disable-auto-import is in use. */
596 _GL_EXTERN_C
__declspec(dllimport
) char **environ
;
598 # if !@HAVE_DECL_ENVIRON@
599 /* Set of environment variables and values. An array of strings of the form
600 "VARIABLE=VALUE", terminated with a NULL. */
601 # if defined __APPLE__ && defined __MACH__
602 # include <TargetConditionals.h>
603 # if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
604 # define _GL_USE_CRT_EXTERNS
607 # ifdef _GL_USE_CRT_EXTERNS
608 # include <crt_externs.h>
609 # define environ (*_NSGetEnviron ())
614 extern char **environ
;
620 #elif defined GNULIB_POSIXCHECK
621 # if HAVE_RAW_DECL_ENVIRON
622 _GL_UNISTD_INLINE
char ***
623 _GL_WARN_ON_USE_ATTRIBUTE ("environ is unportable - "
624 "use gnulib module environ for portability")
630 # define environ (*rpl_environ ())
635 #if @GNULIB_EUIDACCESS@
636 /* Like access(), except that it uses the effective user id and group id of
637 the current process. */
638 # if !@HAVE_EUIDACCESS@
639 _GL_FUNCDECL_SYS (euidaccess
, int, (const char *filename
, int mode
)
640 _GL_ARG_NONNULL ((1)));
642 _GL_CXXALIAS_SYS (euidaccess
, int, (const char *filename
, int mode
));
643 _GL_CXXALIASWARN (euidaccess
);
644 # if defined GNULIB_POSIXCHECK
645 /* Like access(), this function is a security risk. */
646 _GL_WARN_ON_USE (euidaccess
, "the euidaccess function is a security risk - "
647 "use the gnulib module faccessat instead");
649 #elif defined GNULIB_POSIXCHECK
651 # if HAVE_RAW_DECL_EUIDACCESS
652 _GL_WARN_ON_USE (euidaccess
, "euidaccess is unportable - "
653 "use gnulib module euidaccess for portability");
660 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
662 # define execl rpl_execl
664 _GL_FUNCDECL_RPL (execl
, int, (const char *program
, const char *arg
, ...)
665 _GL_ARG_NONNULL ((1)));
666 _GL_CXXALIAS_RPL (execl
, int, (const char *program
, const char *arg
, ...));
668 _GL_CXXALIAS_SYS (execl
, int, (const char *program
, const char *arg
, ...));
670 _GL_CXXALIASWARN (execl
);
671 #elif defined GNULIB_POSIXCHECK
673 # if HAVE_RAW_DECL_EXECL
674 _GL_WARN_ON_USE (execl
, "execl behaves very differently on mingw - "
675 "use gnulib module execl for portability");
677 #elif @GNULIB_MDA_EXECL@
678 /* On native Windows, map 'execl' to '_execl', so that -loldnames is not
679 required. In C++ with GNULIB_NAMESPACE, avoid differences between
680 platforms by defining GNULIB_NAMESPACE::execl always. */
681 # if defined _WIN32 && !defined __CYGWIN__
682 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
684 # define execl _execl
686 _GL_CXXALIAS_MDA (execl
, intptr_t, (const char *program
, const char *arg
, ...));
688 _GL_CXXALIAS_SYS (execl
, int, (const char *program
, const char *arg
, ...));
690 _GL_CXXALIASWARN (execl
);
694 # if @REPLACE_EXECLE@
695 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
697 # define execle rpl_execle
699 _GL_FUNCDECL_RPL (execle
, int, (const char *program
, const char *arg
, ...)
700 _GL_ARG_NONNULL ((1)));
701 _GL_CXXALIAS_RPL (execle
, int, (const char *program
, const char *arg
, ...));
703 _GL_CXXALIAS_SYS (execle
, int, (const char *program
, const char *arg
, ...));
705 _GL_CXXALIASWARN (execle
);
706 #elif defined GNULIB_POSIXCHECK
708 # if HAVE_RAW_DECL_EXECLE
709 _GL_WARN_ON_USE (execle
, "execle behaves very differently on mingw - "
710 "use gnulib module execle for portability");
712 #elif @GNULIB_MDA_EXECLE@
713 /* On native Windows, map 'execle' to '_execle', so that -loldnames is not
714 required. In C++ with GNULIB_NAMESPACE, avoid differences between
715 platforms by defining GNULIB_NAMESPACE::execle always. */
716 # if defined _WIN32 && !defined __CYGWIN__
717 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
719 # define execle _execle
721 _GL_CXXALIAS_MDA (execle
, intptr_t,
722 (const char *program
, const char *arg
, ...));
724 _GL_CXXALIAS_SYS (execle
, int, (const char *program
, const char *arg
, ...));
726 _GL_CXXALIASWARN (execle
);
730 # if @REPLACE_EXECLP@
731 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
733 # define execlp rpl_execlp
735 _GL_FUNCDECL_RPL (execlp
, int, (const char *program
, const char *arg
, ...)
736 _GL_ARG_NONNULL ((1)));
737 _GL_CXXALIAS_RPL (execlp
, int, (const char *program
, const char *arg
, ...));
739 _GL_CXXALIAS_SYS (execlp
, int, (const char *program
, const char *arg
, ...));
741 _GL_CXXALIASWARN (execlp
);
742 #elif defined GNULIB_POSIXCHECK
744 # if HAVE_RAW_DECL_EXECLP
745 _GL_WARN_ON_USE (execlp
, "execlp behaves very differently on mingw - "
746 "use gnulib module execlp for portability");
748 #elif @GNULIB_MDA_EXECLP@
749 /* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not
750 required. In C++ with GNULIB_NAMESPACE, avoid differences between
751 platforms by defining GNULIB_NAMESPACE::execlp always. */
752 # if defined _WIN32 && !defined __CYGWIN__
753 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
755 # define execlp _execlp
757 _GL_CXXALIAS_MDA (execlp
, intptr_t,
758 (const char *program
, const char *arg
, ...));
760 _GL_CXXALIAS_SYS (execlp
, int, (const char *program
, const char *arg
, ...));
762 _GL_CXXALIASWARN (execlp
);
768 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
770 # define execv rpl_execv
772 _GL_FUNCDECL_RPL (execv
, int, (const char *program
, char * const *argv
)
773 _GL_ARG_NONNULL ((1, 2)));
774 _GL_CXXALIAS_RPL (execv
, int, (const char *program
, char * const *argv
));
776 _GL_CXXALIAS_SYS (execv
, int, (const char *program
, char * const *argv
));
778 _GL_CXXALIASWARN (execv
);
779 #elif defined GNULIB_POSIXCHECK
781 # if HAVE_RAW_DECL_EXECV
782 _GL_WARN_ON_USE (execv
, "execv behaves very differently on mingw - "
783 "use gnulib module execv for portability");
785 #elif @GNULIB_MDA_EXECV@
786 /* On native Windows, map 'execv' to '_execv', so that -loldnames is not
787 required. In C++ with GNULIB_NAMESPACE, avoid differences between
788 platforms by defining GNULIB_NAMESPACE::execv always. */
789 # if defined _WIN32 && !defined __CYGWIN__
790 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
792 # define execv _execv
794 _GL_CXXALIAS_MDA_CAST (execv
, intptr_t,
795 (const char *program
, char * const *argv
));
797 _GL_CXXALIAS_SYS (execv
, int, (const char *program
, char * const *argv
));
799 _GL_CXXALIASWARN (execv
);
803 # if @REPLACE_EXECVE@
804 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
806 # define execve rpl_execve
808 _GL_FUNCDECL_RPL (execve
, int,
809 (const char *program
, char * const *argv
, char * const *env
)
810 _GL_ARG_NONNULL ((1, 2)));
811 _GL_CXXALIAS_RPL (execve
, int,
812 (const char *program
, char * const *argv
, char * const *env
));
814 _GL_CXXALIAS_SYS (execve
, int,
815 (const char *program
, char * const *argv
, char * const *env
));
817 _GL_CXXALIASWARN (execve
);
818 #elif defined GNULIB_POSIXCHECK
820 # if HAVE_RAW_DECL_EXECVE
821 _GL_WARN_ON_USE (execve
, "execve behaves very differently on mingw - "
822 "use gnulib module execve for portability");
824 #elif @GNULIB_MDA_EXECVE@
825 /* On native Windows, map 'execve' to '_execve', so that -loldnames is not
826 required. In C++ with GNULIB_NAMESPACE, avoid differences between
827 platforms by defining GNULIB_NAMESPACE::execve always. */
828 # if defined _WIN32 && !defined __CYGWIN__
829 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
831 # define execve _execve
833 _GL_CXXALIAS_MDA_CAST (execve
, intptr_t,
834 (const char *program
, char * const *argv
,
837 _GL_CXXALIAS_SYS (execve
, int,
838 (const char *program
, char * const *argv
, char * const *env
));
840 _GL_CXXALIASWARN (execve
);
844 # if @REPLACE_EXECVP@
845 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
847 # define execvp rpl_execvp
849 _GL_FUNCDECL_RPL (execvp
, int, (const char *program
, char * const *argv
)
850 _GL_ARG_NONNULL ((1, 2)));
851 _GL_CXXALIAS_RPL (execvp
, int, (const char *program
, char * const *argv
));
853 _GL_CXXALIAS_SYS (execvp
, int, (const char *program
, char * const *argv
));
855 _GL_CXXALIASWARN (execvp
);
856 #elif defined GNULIB_POSIXCHECK
858 # if HAVE_RAW_DECL_EXECVP
859 _GL_WARN_ON_USE (execvp
, "execvp behaves very differently on mingw - "
860 "use gnulib module execvp for portability");
862 #elif @GNULIB_MDA_EXECVP@
863 /* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not
864 required. In C++ with GNULIB_NAMESPACE, avoid differences between
865 platforms by defining GNULIB_NAMESPACE::execvp always. */
866 # if defined _WIN32 && !defined __CYGWIN__
867 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
869 # define execvp _execvp
871 _GL_CXXALIAS_MDA_CAST (execvp
, intptr_t,
872 (const char *program
, char * const *argv
));
874 _GL_CXXALIAS_SYS (execvp
, int, (const char *program
, char * const *argv
));
876 _GL_CXXALIASWARN (execvp
);
880 # if @REPLACE_EXECVPE@
881 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
883 # define execvpe rpl_execvpe
885 _GL_FUNCDECL_RPL (execvpe
, int,
886 (const char *program
, char * const *argv
, char * const *env
)
887 _GL_ARG_NONNULL ((1, 2)));
888 _GL_CXXALIAS_RPL (execvpe
, int,
889 (const char *program
, char * const *argv
, char * const *env
));
891 # if !@HAVE_DECL_EXECVPE@
892 _GL_FUNCDECL_SYS (execvpe
, int,
893 (const char *program
, char * const *argv
, char * const *env
)
894 _GL_ARG_NONNULL ((1, 2)));
896 _GL_CXXALIAS_SYS (execvpe
, int,
897 (const char *program
, char * const *argv
, char * const *env
));
900 _GL_CXXALIASWARN (execvpe
);
902 #elif defined GNULIB_POSIXCHECK
904 # if HAVE_RAW_DECL_EXECVPE
905 _GL_WARN_ON_USE (execvpe
, "execvpe behaves very differently on mingw - "
906 "use gnulib module execvpe for portability");
908 #elif @GNULIB_MDA_EXECVPE@
909 /* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not
910 required. In C++ with GNULIB_NAMESPACE, avoid differences between
911 platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have
913 # if defined _WIN32 && !defined __CYGWIN__
914 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
916 # define execvpe _execvpe
918 _GL_CXXALIAS_MDA_CAST (execvpe
, intptr_t,
919 (const char *program
, char * const *argv
,
921 # elif @HAVE_EXECVPE@
922 # if !@HAVE_DECL_EXECVPE@
923 _GL_FUNCDECL_SYS (execvpe
, int,
924 (const char *program
, char * const *argv
, char * const *env
)
925 _GL_ARG_NONNULL ((1, 2)));
927 _GL_CXXALIAS_SYS (execvpe
, int,
928 (const char *program
, char * const *argv
, char * const *env
));
930 # if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_EXECVPE@
931 _GL_CXXALIASWARN (execvpe
);
936 #if @GNULIB_FACCESSAT@
937 # if @REPLACE_FACCESSAT@
938 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
940 # define faccessat rpl_faccessat
942 _GL_FUNCDECL_RPL (faccessat
, int,
943 (int fd
, char const *name
, int mode
, int flag
)
944 _GL_ARG_NONNULL ((2)));
945 _GL_CXXALIAS_RPL (faccessat
, int,
946 (int fd
, char const *name
, int mode
, int flag
));
948 # if !@HAVE_FACCESSAT@
949 _GL_FUNCDECL_SYS (faccessat
, int,
950 (int fd
, char const *file
, int mode
, int flag
)
951 _GL_ARG_NONNULL ((2)));
953 _GL_CXXALIAS_SYS (faccessat
, int,
954 (int fd
, char const *file
, int mode
, int flag
));
957 _GL_CXXALIASWARN (faccessat
);
959 #elif defined GNULIB_POSIXCHECK
961 # if HAVE_RAW_DECL_FACCESSAT
962 _GL_WARN_ON_USE (faccessat
, "faccessat is not portable - "
963 "use gnulib module faccessat for portability");
969 /* Change the process' current working directory to the directory on which
970 the given file descriptor is open.
971 Return 0 if successful, otherwise -1 and errno set.
972 See the POSIX:2008 specification
973 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */
974 # if @REPLACE_FCHDIR@
975 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
977 # define fchdir rpl_fchdir
979 _GL_FUNCDECL_RPL (fchdir
, int, (int /*fd*/));
980 _GL_CXXALIAS_RPL (fchdir
, int, (int /*fd*/));
982 # if !@HAVE_FCHDIR@ || !@HAVE_DECL_FCHDIR@
983 _GL_FUNCDECL_SYS (fchdir
, int, (int /*fd*/));
985 _GL_CXXALIAS_SYS (fchdir
, int, (int /*fd*/));
987 _GL_CXXALIASWARN (fchdir
);
988 # if @REPLACE_FCHDIR@ || !@HAVE_FCHDIR@
989 /* Gnulib internal hooks needed to maintain the fchdir metadata. */
990 _GL_EXTERN_C
int _gl_register_fd (int fd
, const char *filename
)
991 _GL_ARG_NONNULL ((2));
992 _GL_EXTERN_C
void _gl_unregister_fd (int fd
);
993 _GL_EXTERN_C
int _gl_register_dup (int oldfd
, int newfd
);
994 _GL_EXTERN_C
const char *_gl_directory_name (int fd
);
996 #elif defined GNULIB_POSIXCHECK
998 # if HAVE_RAW_DECL_FCHDIR
999 _GL_WARN_ON_USE (fchdir
, "fchdir is unportable - "
1000 "use gnulib module fchdir for portability");
1005 #if @GNULIB_FCHOWNAT@
1006 # if @REPLACE_FCHOWNAT@
1007 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1009 # define fchownat rpl_fchownat
1011 _GL_FUNCDECL_RPL (fchownat
, int, (int fd
, char const *file
,
1012 uid_t owner
, gid_t group
, int flag
)
1013 _GL_ARG_NONNULL ((2)));
1014 _GL_CXXALIAS_RPL (fchownat
, int, (int fd
, char const *file
,
1015 uid_t owner
, gid_t group
, int flag
));
1017 # if !@HAVE_FCHOWNAT@
1018 _GL_FUNCDECL_SYS (fchownat
, int, (int fd
, char const *file
,
1019 uid_t owner
, gid_t group
, int flag
)
1020 _GL_ARG_NONNULL ((2)));
1022 _GL_CXXALIAS_SYS (fchownat
, int, (int fd
, char const *file
,
1023 uid_t owner
, gid_t group
, int flag
));
1025 _GL_CXXALIASWARN (fchownat
);
1026 #elif defined GNULIB_POSIXCHECK
1028 # if HAVE_RAW_DECL_FCHOWNAT
1029 _GL_WARN_ON_USE (fchownat
, "fchownat is not portable - "
1030 "use gnulib module fchownat for portability");
1035 #if @GNULIB_FDATASYNC@
1036 /* Synchronize changes to a file.
1037 Return 0 if successful, otherwise -1 and errno set.
1038 See POSIX:2008 specification
1039 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */
1040 # if @REPLACE_FDATASYNC@
1041 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1043 # define fdatasync rpl_fdatasync
1045 _GL_FUNCDECL_RPL (fdatasync
, int, (int fd
));
1046 _GL_CXXALIAS_RPL (fdatasync
, int, (int fd
));
1048 # if !@HAVE_FDATASYNC@|| !@HAVE_DECL_FDATASYNC@
1049 _GL_FUNCDECL_SYS (fdatasync
, int, (int fd
));
1051 _GL_CXXALIAS_SYS (fdatasync
, int, (int fd
));
1054 _GL_CXXALIASWARN (fdatasync
);
1056 #elif defined GNULIB_POSIXCHECK
1058 # if HAVE_RAW_DECL_FDATASYNC
1059 _GL_WARN_ON_USE (fdatasync
, "fdatasync is unportable - "
1060 "use gnulib module fdatasync for portability");
1066 /* Synchronize changes, including metadata, to a file.
1067 Return 0 if successful, otherwise -1 and errno set.
1068 See POSIX:2008 specification
1069 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */
1071 _GL_FUNCDECL_SYS (fsync
, int, (int fd
));
1073 _GL_CXXALIAS_SYS (fsync
, int, (int fd
));
1074 _GL_CXXALIASWARN (fsync
);
1075 #elif defined GNULIB_POSIXCHECK
1077 # if HAVE_RAW_DECL_FSYNC
1078 _GL_WARN_ON_USE (fsync
, "fsync is unportable - "
1079 "use gnulib module fsync for portability");
1084 #if @GNULIB_FTRUNCATE@
1085 /* Change the size of the file to which FD is opened to become equal to LENGTH.
1086 Return 0 if successful, otherwise -1 and errno set.
1087 See the POSIX:2008 specification
1088 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */
1089 # if @REPLACE_FTRUNCATE@
1090 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1092 # define ftruncate rpl_ftruncate
1094 _GL_FUNCDECL_RPL (ftruncate
, int, (int fd
, off_t length
));
1095 _GL_CXXALIAS_RPL (ftruncate
, int, (int fd
, off_t length
));
1097 # if !@HAVE_FTRUNCATE@
1098 _GL_FUNCDECL_SYS (ftruncate
, int, (int fd
, off_t length
));
1100 _GL_CXXALIAS_SYS (ftruncate
, int, (int fd
, off_t length
));
1103 _GL_CXXALIASWARN (ftruncate
);
1105 #elif defined GNULIB_POSIXCHECK
1107 # if HAVE_RAW_DECL_FTRUNCATE
1108 _GL_WARN_ON_USE (ftruncate
, "ftruncate is unportable - "
1109 "use gnulib module ftruncate for portability");
1115 /* Get the name of the current working directory, and put it in SIZE bytes
1117 Return BUF if successful, or NULL if the directory couldn't be determined
1118 or SIZE was too small.
1119 See the POSIX:2008 specification
1120 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
1121 Additionally, the gnulib module 'getcwd' or 'getcwd-lgpl' guarantees the
1122 following GNU extension: If BUF is NULL, an array is allocated with
1123 'malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case
1124 it is as big as necessary. */
1125 # if @REPLACE_GETCWD@
1126 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1127 # define getcwd rpl_getcwd
1129 _GL_FUNCDECL_RPL (getcwd
, char *, (char *buf
, size_t size
));
1130 _GL_CXXALIAS_RPL (getcwd
, char *, (char *buf
, size_t size
));
1131 # elif defined _WIN32 && !defined __CYGWIN__
1132 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1134 # define getcwd _getcwd
1136 _GL_CXXALIAS_MDA (getcwd
, char *, (char *buf
, size_t size
));
1138 /* Need to cast, because on mingw, the second parameter is
1140 _GL_CXXALIAS_SYS_CAST (getcwd
, char *, (char *buf
, size_t size
));
1142 _GL_CXXALIASWARN (getcwd
);
1143 #elif defined GNULIB_POSIXCHECK
1145 # if HAVE_RAW_DECL_GETCWD
1146 _GL_WARN_ON_USE (getcwd
, "getcwd is unportable - "
1147 "use gnulib module getcwd for portability");
1149 #elif @GNULIB_MDA_GETCWD@
1150 /* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not
1151 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1152 platforms by defining GNULIB_NAMESPACE::getcwd always. */
1153 # if defined _WIN32 && !defined __CYGWIN__
1154 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1156 # define getcwd _getcwd
1158 /* Need to cast, because on mingw, the second parameter is either
1159 'int size' or 'size_t size'. */
1160 _GL_CXXALIAS_MDA_CAST (getcwd
, char *, (char *buf
, size_t size
));
1162 _GL_CXXALIAS_SYS_CAST (getcwd
, char *, (char *buf
, size_t size
));
1164 _GL_CXXALIASWARN (getcwd
);
1168 #if @GNULIB_GETDOMAINNAME@
1169 /* Return the NIS domain name of the machine.
1170 WARNING! The NIS domain name is unrelated to the fully qualified host name
1171 of the machine. It is also unrelated to email addresses.
1172 WARNING! The NIS domain name is usually the empty string or "(none)" when
1175 Put up to LEN bytes of the NIS domain name into NAME.
1176 Null terminate it if the name is shorter than LEN.
1177 If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
1178 Return 0 if successful, otherwise set errno and return -1. */
1179 # if @REPLACE_GETDOMAINNAME@
1180 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1181 # undef getdomainname
1182 # define getdomainname rpl_getdomainname
1184 _GL_FUNCDECL_RPL (getdomainname
, int, (char *name
, size_t len
)
1185 _GL_ARG_NONNULL ((1)));
1186 _GL_CXXALIAS_RPL (getdomainname
, int, (char *name
, size_t len
));
1188 # if !@HAVE_DECL_GETDOMAINNAME@
1189 _GL_FUNCDECL_SYS (getdomainname
, int, (char *name
, size_t len
)
1190 _GL_ARG_NONNULL ((1)));
1192 _GL_CXXALIAS_SYS (getdomainname
, int, (char *name
, size_t len
));
1195 _GL_CXXALIASWARN (getdomainname
);
1197 #elif defined GNULIB_POSIXCHECK
1198 # undef getdomainname
1199 # if HAVE_RAW_DECL_GETDOMAINNAME
1200 _GL_WARN_ON_USE (getdomainname
, "getdomainname is unportable - "
1201 "use gnulib module getdomainname for portability");
1206 #if @GNULIB_GETDTABLESIZE@
1207 /* Return the maximum number of file descriptors in the current process.
1208 In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
1209 # if @REPLACE_GETDTABLESIZE@
1210 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1211 # undef getdtablesize
1212 # define getdtablesize rpl_getdtablesize
1214 _GL_FUNCDECL_RPL (getdtablesize
, int, (void));
1215 _GL_CXXALIAS_RPL (getdtablesize
, int, (void));
1217 # if !@HAVE_GETDTABLESIZE@
1218 _GL_FUNCDECL_SYS (getdtablesize
, int, (void));
1220 /* Need to cast, because on AIX, the parameter list is
1222 _GL_CXXALIAS_SYS_CAST (getdtablesize
, int, (void));
1224 _GL_CXXALIASWARN (getdtablesize
);
1225 #elif defined GNULIB_POSIXCHECK
1226 # undef getdtablesize
1227 # if HAVE_RAW_DECL_GETDTABLESIZE
1228 _GL_WARN_ON_USE (getdtablesize
, "getdtablesize is unportable - "
1229 "use gnulib module getdtablesize for portability");
1234 #if @GNULIB_GETENTROPY@
1235 /* Fill a buffer with random bytes. */
1236 # if @REPLACE_GETENTROPY@
1237 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1239 # define getentropy rpl_getentropy
1241 _GL_FUNCDECL_RPL (getentropy
, int, (void *buffer
, size_t length
));
1242 _GL_CXXALIAS_RPL (getentropy
, int, (void *buffer
, size_t length
));
1244 # if !@HAVE_GETENTROPY@
1245 _GL_FUNCDECL_SYS (getentropy
, int, (void *buffer
, size_t length
));
1247 _GL_CXXALIAS_SYS (getentropy
, int, (void *buffer
, size_t length
));
1250 _GL_CXXALIASWARN (getentropy
);
1252 #elif defined GNULIB_POSIXCHECK
1254 # if HAVE_RAW_DECL_GETENTROPY
1255 _GL_WARN_ON_USE (getentropy
, "getentropy is unportable - "
1256 "use gnulib module getentropy for portability");
1261 #if @GNULIB_GETGROUPS@
1262 /* Return the supplemental groups that the current process belongs to.
1263 It is unspecified whether the effective group id is in the list.
1264 If N is 0, return the group count; otherwise, N describes how many
1265 entries are available in GROUPS. Return -1 and set errno if N is
1266 not 0 and not large enough. Fails with ENOSYS on some systems. */
1267 # if @REPLACE_GETGROUPS@
1268 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1270 # define getgroups rpl_getgroups
1272 _GL_FUNCDECL_RPL (getgroups
, int, (int n
, gid_t
*groups
));
1273 _GL_CXXALIAS_RPL (getgroups
, int, (int n
, gid_t
*groups
));
1275 # if !@HAVE_GETGROUPS@
1276 _GL_FUNCDECL_SYS (getgroups
, int, (int n
, gid_t
*groups
));
1278 _GL_CXXALIAS_SYS (getgroups
, int, (int n
, gid_t
*groups
));
1280 _GL_CXXALIASWARN (getgroups
);
1281 #elif defined GNULIB_POSIXCHECK
1283 # if HAVE_RAW_DECL_GETGROUPS
1284 _GL_WARN_ON_USE (getgroups
, "getgroups is unportable - "
1285 "use gnulib module getgroups for portability");
1290 #if @GNULIB_GETHOSTNAME@
1291 /* Return the standard host name of the machine.
1292 WARNING! The host name may or may not be fully qualified.
1294 Put up to LEN bytes of the host name into NAME.
1295 Null terminate it if the name is shorter than LEN.
1296 If the host name is longer than LEN, set errno = EINVAL and return -1.
1297 Return 0 if successful, otherwise set errno and return -1. */
1298 # if @UNISTD_H_HAVE_WINSOCK2_H@
1299 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1301 # define gethostname rpl_gethostname
1303 _GL_FUNCDECL_RPL (gethostname
, int, (char *name
, size_t len
)
1304 _GL_ARG_NONNULL ((1)));
1305 _GL_CXXALIAS_RPL (gethostname
, int, (char *name
, size_t len
));
1307 # if !@HAVE_GETHOSTNAME@
1308 _GL_FUNCDECL_SYS (gethostname
, int, (char *name
, size_t len
)
1309 _GL_ARG_NONNULL ((1)));
1311 /* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
1314 _GL_CXXALIAS_SYS_CAST (gethostname
, int, (char *name
, size_t len
));
1316 _GL_CXXALIASWARN (gethostname
);
1317 #elif @UNISTD_H_HAVE_WINSOCK2_H@
1319 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
1320 #elif defined GNULIB_POSIXCHECK
1322 # if HAVE_RAW_DECL_GETHOSTNAME
1323 _GL_WARN_ON_USE (gethostname
, "gethostname is unportable - "
1324 "use gnulib module gethostname for portability");
1329 #if @GNULIB_GETLOGIN@
1330 /* Returns the user's login name, or NULL if it cannot be found. Upon error,
1331 returns NULL with errno set.
1333 See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
1335 Most programs don't need to use this function, because the information is
1336 available through environment variables:
1337 ${LOGNAME-$USER} on Unix platforms,
1338 $USERNAME on native Windows platforms.
1340 # if !@HAVE_DECL_GETLOGIN@
1341 _GL_FUNCDECL_SYS (getlogin
, char *, (void));
1343 _GL_CXXALIAS_SYS (getlogin
, char *, (void));
1344 _GL_CXXALIASWARN (getlogin
);
1345 #elif defined GNULIB_POSIXCHECK
1347 # if HAVE_RAW_DECL_GETLOGIN
1348 _GL_WARN_ON_USE (getlogin
, "getlogin is unportable - "
1349 "use gnulib module getlogin for portability");
1354 #if @GNULIB_GETLOGIN_R@
1355 /* Copies the user's login name to NAME.
1356 The array pointed to by NAME has room for SIZE bytes.
1358 Returns 0 if successful. Upon error, an error number is returned, or -1 in
1359 the case that the login name cannot be found but no specific error is
1360 provided (this case is hopefully rare but is left open by the POSIX spec).
1362 See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
1364 Most programs don't need to use this function, because the information is
1365 available through environment variables:
1366 ${LOGNAME-$USER} on Unix platforms,
1367 $USERNAME on native Windows platforms.
1369 # if @REPLACE_GETLOGIN_R@
1370 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1371 # define getlogin_r rpl_getlogin_r
1373 _GL_FUNCDECL_RPL (getlogin_r
, int, (char *name
, size_t size
)
1374 _GL_ARG_NONNULL ((1)));
1375 _GL_CXXALIAS_RPL (getlogin_r
, int, (char *name
, size_t size
));
1377 # if !@HAVE_DECL_GETLOGIN_R@
1378 _GL_FUNCDECL_SYS (getlogin_r
, int, (char *name
, size_t size
)
1379 _GL_ARG_NONNULL ((1)));
1381 /* Need to cast, because on Solaris 10 systems, the second argument is
1383 _GL_CXXALIAS_SYS_CAST (getlogin_r
, int, (char *name
, size_t size
));
1386 _GL_CXXALIASWARN (getlogin_r
);
1388 #elif defined GNULIB_POSIXCHECK
1390 # if HAVE_RAW_DECL_GETLOGIN_R
1391 _GL_WARN_ON_USE (getlogin_r
, "getlogin_r is unportable - "
1392 "use gnulib module getlogin_r for portability");
1397 #if @GNULIB_GETPAGESIZE@
1398 # if @REPLACE_GETPAGESIZE@
1399 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1400 # define getpagesize rpl_getpagesize
1402 _GL_FUNCDECL_RPL (getpagesize
, int, (void));
1403 _GL_CXXALIAS_RPL (getpagesize
, int, (void));
1405 /* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if
1406 the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */
1408 _GL_FUNCDECL_SYS (getpagesize
, int, (void));
1410 # if !@HAVE_GETPAGESIZE@
1411 # if !defined getpagesize
1412 /* This is for POSIX systems. */
1413 # if !defined _gl_getpagesize && defined _SC_PAGESIZE
1414 # if ! (defined __VMS && __VMS_VER < 70000000)
1415 # define _gl_getpagesize() sysconf (_SC_PAGESIZE)
1418 /* This is for older VMS. */
1419 # if !defined _gl_getpagesize && defined __VMS
1421 # define _gl_getpagesize() 8192
1423 # define _gl_getpagesize() 512
1426 /* This is for BeOS. */
1427 # if !defined _gl_getpagesize && @HAVE_OS_H@
1429 # if defined B_PAGE_SIZE
1430 # define _gl_getpagesize() B_PAGE_SIZE
1433 /* This is for AmigaOS4.0. */
1434 # if !defined _gl_getpagesize && defined __amigaos4__
1435 # define _gl_getpagesize() 2048
1437 /* This is for older Unix systems. */
1438 # if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
1439 # include <sys/param.h>
1440 # ifdef EXEC_PAGESIZE
1441 # define _gl_getpagesize() EXEC_PAGESIZE
1447 # define _gl_getpagesize() (NBPG * CLSIZE)
1450 # define _gl_getpagesize() NBPC
1455 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1456 # define getpagesize() _gl_getpagesize ()
1458 # if !GNULIB_defined_getpagesize_function
1459 _GL_UNISTD_INLINE
int
1462 return _gl_getpagesize ();
1464 # define GNULIB_defined_getpagesize_function 1
1469 /* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t. */
1470 _GL_CXXALIAS_SYS_CAST (getpagesize
, int, (void));
1472 # if @HAVE_DECL_GETPAGESIZE@
1473 _GL_CXXALIASWARN (getpagesize
);
1475 #elif defined GNULIB_POSIXCHECK
1477 # if HAVE_RAW_DECL_GETPAGESIZE
1478 _GL_WARN_ON_USE (getpagesize
, "getpagesize is unportable - "
1479 "use gnulib module getpagesize for portability");
1484 #if @GNULIB_GETPASS@
1485 /* Function getpass() from module 'getpass':
1486 Read a password from /dev/tty or stdin.
1487 Function getpass() from module 'getpass-gnu':
1488 Read a password of arbitrary length from /dev/tty or stdin. */
1489 # if (@GNULIB_GETPASS@ && @REPLACE_GETPASS@) \
1490 || (@GNULIB_GETPASS_GNU@ && @REPLACE_GETPASS_FOR_GETPASS_GNU@)
1491 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1493 # define getpass rpl_getpass
1495 _GL_FUNCDECL_RPL (getpass
, char *, (const char *prompt
)
1496 _GL_ARG_NONNULL ((1)));
1497 _GL_CXXALIAS_RPL (getpass
, char *, (const char *prompt
));
1499 # if !@HAVE_GETPASS@
1500 _GL_FUNCDECL_SYS (getpass
, char *, (const char *prompt
)
1501 _GL_ARG_NONNULL ((1)));
1503 _GL_CXXALIAS_SYS (getpass
, char *, (const char *prompt
));
1505 _GL_CXXALIASWARN (getpass
);
1506 #elif defined GNULIB_POSIXCHECK
1508 # if HAVE_RAW_DECL_GETPASS
1509 _GL_WARN_ON_USE (getpass
, "getpass is unportable - "
1510 "use gnulib module getpass or getpass-gnu for portability");
1515 #if @GNULIB_MDA_GETPID@
1516 /* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not
1517 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1518 platforms by defining GNULIB_NAMESPACE::getpid always. */
1519 # if defined _WIN32 && !defined __CYGWIN__
1520 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1522 # define getpid _getpid
1524 _GL_CXXALIAS_MDA (getpid
, int, (void));
1526 _GL_CXXALIAS_SYS (getpid
, pid_t
, (void));
1528 _GL_CXXALIASWARN (getpid
);
1532 #if @GNULIB_GETUSERSHELL@
1533 /* Return the next valid login shell on the system, or NULL when the end of
1534 the list has been reached. */
1535 # if !@HAVE_DECL_GETUSERSHELL@
1536 _GL_FUNCDECL_SYS (getusershell
, char *, (void));
1538 _GL_CXXALIAS_SYS (getusershell
, char *, (void));
1539 _GL_CXXALIASWARN (getusershell
);
1540 #elif defined GNULIB_POSIXCHECK
1541 # undef getusershell
1542 # if HAVE_RAW_DECL_GETUSERSHELL
1543 _GL_WARN_ON_USE (getusershell
, "getusershell is unportable - "
1544 "use gnulib module getusershell for portability");
1548 #if @GNULIB_GETUSERSHELL@
1549 /* Rewind to pointer that is advanced at each getusershell() call. */
1550 # if !@HAVE_DECL_GETUSERSHELL@
1551 _GL_FUNCDECL_SYS (setusershell
, void, (void));
1553 _GL_CXXALIAS_SYS (setusershell
, void, (void));
1554 _GL_CXXALIASWARN (setusershell
);
1555 #elif defined GNULIB_POSIXCHECK
1556 # undef setusershell
1557 # if HAVE_RAW_DECL_SETUSERSHELL
1558 _GL_WARN_ON_USE (setusershell
, "setusershell is unportable - "
1559 "use gnulib module getusershell for portability");
1563 #if @GNULIB_GETUSERSHELL@
1564 /* Free the pointer that is advanced at each getusershell() call and
1565 associated resources. */
1566 # if !@HAVE_DECL_GETUSERSHELL@
1567 _GL_FUNCDECL_SYS (endusershell
, void, (void));
1569 _GL_CXXALIAS_SYS (endusershell
, void, (void));
1570 _GL_CXXALIASWARN (endusershell
);
1571 #elif defined GNULIB_POSIXCHECK
1572 # undef endusershell
1573 # if HAVE_RAW_DECL_ENDUSERSHELL
1574 _GL_WARN_ON_USE (endusershell
, "endusershell is unportable - "
1575 "use gnulib module getusershell for portability");
1580 #if @GNULIB_GROUP_MEMBER@
1581 /* Determine whether group id is in calling user's group list. */
1582 # if !@HAVE_GROUP_MEMBER@
1583 _GL_FUNCDECL_SYS (group_member
, int, (gid_t gid
));
1585 _GL_CXXALIAS_SYS (group_member
, int, (gid_t gid
));
1586 _GL_CXXALIASWARN (group_member
);
1587 #elif defined GNULIB_POSIXCHECK
1588 # undef group_member
1589 # if HAVE_RAW_DECL_GROUP_MEMBER
1590 _GL_WARN_ON_USE (group_member
, "group_member is unportable - "
1591 "use gnulib module group-member for portability");
1597 # if @REPLACE_ISATTY@
1598 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1600 # define isatty rpl_isatty
1602 # define GNULIB_defined_isatty 1
1603 _GL_FUNCDECL_RPL (isatty
, int, (int fd
));
1604 _GL_CXXALIAS_RPL (isatty
, int, (int fd
));
1605 # elif defined _WIN32 && !defined __CYGWIN__
1606 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1608 # define isatty _isatty
1610 _GL_CXXALIAS_MDA (isatty
, int, (int fd
));
1612 _GL_CXXALIAS_SYS (isatty
, int, (int fd
));
1614 _GL_CXXALIASWARN (isatty
);
1615 #elif defined GNULIB_POSIXCHECK
1617 # if HAVE_RAW_DECL_ISATTY
1618 _GL_WARN_ON_USE (isatty
, "isatty has portability problems on native Windows - "
1619 "use gnulib module isatty for portability");
1621 #elif @GNULIB_MDA_ISATTY@
1622 /* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not
1623 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1624 platforms by defining GNULIB_NAMESPACE::isatty always. */
1625 # if defined _WIN32 && !defined __CYGWIN__
1626 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1628 # define isatty _isatty
1630 _GL_CXXALIAS_MDA (isatty
, int, (int fd
));
1632 _GL_CXXALIAS_SYS (isatty
, int, (int fd
));
1634 _GL_CXXALIASWARN (isatty
);
1639 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
1640 to GID (if GID is not -1). Do not follow symbolic links.
1641 Return 0 if successful, otherwise -1 and errno set.
1642 See the POSIX:2008 specification
1643 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */
1644 # if @REPLACE_LCHOWN@
1645 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1647 # define lchown rpl_lchown
1649 _GL_FUNCDECL_RPL (lchown
, int, (char const *file
, uid_t owner
, gid_t group
)
1650 _GL_ARG_NONNULL ((1)));
1651 _GL_CXXALIAS_RPL (lchown
, int, (char const *file
, uid_t owner
, gid_t group
));
1654 _GL_FUNCDECL_SYS (lchown
, int, (char const *file
, uid_t owner
, gid_t group
)
1655 _GL_ARG_NONNULL ((1)));
1657 _GL_CXXALIAS_SYS (lchown
, int, (char const *file
, uid_t owner
, gid_t group
));
1659 _GL_CXXALIASWARN (lchown
);
1660 #elif defined GNULIB_POSIXCHECK
1662 # if HAVE_RAW_DECL_LCHOWN
1663 _GL_WARN_ON_USE (lchown
, "lchown is unportable to pre-POSIX.1-2001 systems - "
1664 "use gnulib module lchown for portability");
1670 /* Create a new hard link for an existing file.
1671 Return 0 if successful, otherwise -1 and errno set.
1672 See POSIX:2008 specification
1673 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */
1675 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1676 # define link rpl_link
1678 _GL_FUNCDECL_RPL (link
, int, (const char *path1
, const char *path2
)
1679 _GL_ARG_NONNULL ((1, 2)));
1680 _GL_CXXALIAS_RPL (link
, int, (const char *path1
, const char *path2
));
1683 _GL_FUNCDECL_SYS (link
, int, (const char *path1
, const char *path2
)
1684 _GL_ARG_NONNULL ((1, 2)));
1686 _GL_CXXALIAS_SYS (link
, int, (const char *path1
, const char *path2
));
1688 _GL_CXXALIASWARN (link
);
1689 #elif defined GNULIB_POSIXCHECK
1691 # if HAVE_RAW_DECL_LINK
1692 _GL_WARN_ON_USE (link
, "link is unportable - "
1693 "use gnulib module link for portability");
1699 /* Create a new hard link for an existing file, relative to two
1700 directories. FLAG controls whether symlinks are followed.
1701 Return 0 if successful, otherwise -1 and errno set. */
1702 # if @REPLACE_LINKAT@
1703 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1705 # define linkat rpl_linkat
1707 _GL_FUNCDECL_RPL (linkat
, int,
1708 (int fd1
, const char *path1
, int fd2
, const char *path2
,
1710 _GL_ARG_NONNULL ((2, 4)));
1711 _GL_CXXALIAS_RPL (linkat
, int,
1712 (int fd1
, const char *path1
, int fd2
, const char *path2
,
1716 _GL_FUNCDECL_SYS (linkat
, int,
1717 (int fd1
, const char *path1
, int fd2
, const char *path2
,
1719 _GL_ARG_NONNULL ((2, 4)));
1721 _GL_CXXALIAS_SYS (linkat
, int,
1722 (int fd1
, const char *path1
, int fd2
, const char *path2
,
1726 _GL_CXXALIASWARN (linkat
);
1728 #elif defined GNULIB_POSIXCHECK
1730 # if HAVE_RAW_DECL_LINKAT
1731 _GL_WARN_ON_USE (linkat
, "linkat is unportable - "
1732 "use gnulib module linkat for portability");
1738 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
1739 Return the new offset if successful, otherwise -1 and errno set.
1740 See the POSIX:2008 specification
1741 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */
1742 # if @REPLACE_LSEEK@
1743 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1744 # define lseek rpl_lseek
1746 _GL_FUNCDECL_RPL (lseek
, off_t
, (int fd
, off_t offset
, int whence
));
1747 _GL_CXXALIAS_RPL (lseek
, off_t
, (int fd
, off_t offset
, int whence
));
1748 # elif defined _WIN32 && !defined __CYGWIN__
1749 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1751 # define lseek _lseek
1753 _GL_CXXALIAS_MDA (lseek
, off_t
, (int fd
, off_t offset
, int whence
));
1755 _GL_CXXALIAS_SYS (lseek
, off_t
, (int fd
, off_t offset
, int whence
));
1757 _GL_CXXALIASWARN (lseek
);
1758 #elif defined GNULIB_POSIXCHECK
1760 # if HAVE_RAW_DECL_LSEEK
1761 _GL_WARN_ON_USE (lseek
, "lseek does not fail with ESPIPE on pipes on some "
1762 "systems - use gnulib module lseek for portability");
1764 #elif @GNULIB_MDA_LSEEK@
1765 /* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not
1766 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1767 platforms by defining GNULIB_NAMESPACE::lseek always. */
1768 # if defined _WIN32 && !defined __CYGWIN__
1769 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1771 # define lseek _lseek
1773 _GL_CXXALIAS_MDA (lseek
, long, (int fd
, long offset
, int whence
));
1775 _GL_CXXALIAS_SYS (lseek
, off_t
, (int fd
, off_t offset
, int whence
));
1777 _GL_CXXALIASWARN (lseek
);
1782 /* Create a pipe, defaulting to O_BINARY mode.
1783 Store the read-end as fd[0] and the write-end as fd[1].
1784 Return 0 upon success, or -1 with errno set upon failure. */
1786 _GL_FUNCDECL_SYS (pipe
, int, (int fd
[2]) _GL_ARG_NONNULL ((1)));
1788 _GL_CXXALIAS_SYS (pipe
, int, (int fd
[2]));
1789 _GL_CXXALIASWARN (pipe
);
1790 #elif defined GNULIB_POSIXCHECK
1792 # if HAVE_RAW_DECL_PIPE
1793 _GL_WARN_ON_USE (pipe
, "pipe is unportable - "
1794 "use gnulib module pipe-posix for portability");
1800 /* Create a pipe, applying the given flags when opening the read-end of the
1801 pipe and the write-end of the pipe.
1802 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
1803 and O_TEXT, O_BINARY (defined in "binary-io.h").
1804 Store the read-end as fd[0] and the write-end as fd[1].
1805 Return 0 upon success, or -1 with errno set upon failure.
1806 See also the Linux man page at
1807 <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
1808 # if @REPLACE_PIPE2@
1809 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1811 # define pipe2 rpl_pipe2
1813 _GL_FUNCDECL_RPL (pipe2
, int, (int fd
[2], int flags
) _GL_ARG_NONNULL ((1)));
1814 _GL_CXXALIAS_RPL (pipe2
, int, (int fd
[2], int flags
));
1816 _GL_FUNCDECL_SYS (pipe2
, int, (int fd
[2], int flags
) _GL_ARG_NONNULL ((1)));
1817 _GL_CXXALIAS_SYS (pipe2
, int, (int fd
[2], int flags
));
1820 _GL_CXXALIASWARN (pipe2
);
1822 #elif defined GNULIB_POSIXCHECK
1824 # if HAVE_RAW_DECL_PIPE2
1825 _GL_WARN_ON_USE (pipe2
, "pipe2 is unportable - "
1826 "use gnulib module pipe2 for portability");
1832 /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
1833 Return the number of bytes placed into BUF if successful, otherwise
1834 set errno and return -1. 0 indicates EOF.
1835 See the POSIX:2008 specification
1836 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */
1837 # if @REPLACE_PREAD@
1838 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1840 # define pread rpl_pread
1842 _GL_FUNCDECL_RPL (pread
, ssize_t
,
1843 (int fd
, void *buf
, size_t bufsize
, off_t offset
)
1844 _GL_ARG_NONNULL ((2)));
1845 _GL_CXXALIAS_RPL (pread
, ssize_t
,
1846 (int fd
, void *buf
, size_t bufsize
, off_t offset
));
1849 _GL_FUNCDECL_SYS (pread
, ssize_t
,
1850 (int fd
, void *buf
, size_t bufsize
, off_t offset
)
1851 _GL_ARG_NONNULL ((2)));
1853 _GL_CXXALIAS_SYS (pread
, ssize_t
,
1854 (int fd
, void *buf
, size_t bufsize
, off_t offset
));
1857 _GL_CXXALIASWARN (pread
);
1859 #elif defined GNULIB_POSIXCHECK
1861 # if HAVE_RAW_DECL_PREAD
1862 _GL_WARN_ON_USE (pread
, "pread is unportable - "
1863 "use gnulib module pread for portability");
1869 /* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
1870 Return the number of bytes written if successful, otherwise
1871 set errno and return -1. 0 indicates nothing written. See the
1872 POSIX:2008 specification
1873 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */
1874 # if @REPLACE_PWRITE@
1875 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1877 # define pwrite rpl_pwrite
1879 _GL_FUNCDECL_RPL (pwrite
, ssize_t
,
1880 (int fd
, const void *buf
, size_t bufsize
, off_t offset
)
1881 _GL_ARG_NONNULL ((2)));
1882 _GL_CXXALIAS_RPL (pwrite
, ssize_t
,
1883 (int fd
, const void *buf
, size_t bufsize
, off_t offset
));
1886 _GL_FUNCDECL_SYS (pwrite
, ssize_t
,
1887 (int fd
, const void *buf
, size_t bufsize
, off_t offset
)
1888 _GL_ARG_NONNULL ((2)));
1890 _GL_CXXALIAS_SYS (pwrite
, ssize_t
,
1891 (int fd
, const void *buf
, size_t bufsize
, off_t offset
));
1894 _GL_CXXALIASWARN (pwrite
);
1896 #elif defined GNULIB_POSIXCHECK
1898 # if HAVE_RAW_DECL_PWRITE
1899 _GL_WARN_ON_USE (pwrite
, "pwrite is unportable - "
1900 "use gnulib module pwrite for portability");
1906 /* Read up to COUNT bytes from file descriptor FD into the buffer starting
1907 at BUF. See the POSIX:2008 specification
1908 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */
1910 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1912 # define read rpl_read
1914 _GL_FUNCDECL_RPL (read
, ssize_t
, (int fd
, void *buf
, size_t count
)
1915 _GL_ARG_NONNULL ((2)));
1916 _GL_CXXALIAS_RPL (read
, ssize_t
, (int fd
, void *buf
, size_t count
));
1917 # elif defined _WIN32 && !defined __CYGWIN__
1918 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1922 _GL_CXXALIAS_MDA (read
, ssize_t
, (int fd
, void *buf
, size_t count
));
1924 _GL_CXXALIAS_SYS (read
, ssize_t
, (int fd
, void *buf
, size_t count
));
1926 _GL_CXXALIASWARN (read
);
1927 #elif @GNULIB_MDA_READ@
1928 /* On native Windows, map 'read' to '_read', so that -loldnames is not
1929 required. In C++ with GNULIB_NAMESPACE, avoid differences between
1930 platforms by defining GNULIB_NAMESPACE::read always. */
1931 # if defined _WIN32 && !defined __CYGWIN__
1932 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1937 _GL_CXXALIAS_MDA (read
, int, (int fd
, void *buf
, unsigned int count
));
1939 _GL_CXXALIAS_MDA (read
, ssize_t
, (int fd
, void *buf
, unsigned int count
));
1942 _GL_CXXALIAS_SYS (read
, ssize_t
, (int fd
, void *buf
, size_t count
));
1944 _GL_CXXALIASWARN (read
);
1948 #if @GNULIB_READLINK@
1949 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
1950 bytes of it into BUF. Return the number of bytes placed into BUF if
1951 successful, otherwise -1 and errno set.
1952 See the POSIX:2008 specification
1953 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */
1954 # if @REPLACE_READLINK@
1955 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1956 # define readlink rpl_readlink
1958 _GL_FUNCDECL_RPL (readlink
, ssize_t
,
1959 (const char *restrict file
,
1960 char *restrict buf
, size_t bufsize
)
1961 _GL_ARG_NONNULL ((1, 2)));
1962 _GL_CXXALIAS_RPL (readlink
, ssize_t
,
1963 (const char *restrict file
,
1964 char *restrict buf
, size_t bufsize
));
1966 # if !@HAVE_READLINK@
1967 _GL_FUNCDECL_SYS (readlink
, ssize_t
,
1968 (const char *restrict file
,
1969 char *restrict buf
, size_t bufsize
)
1970 _GL_ARG_NONNULL ((1, 2)));
1972 _GL_CXXALIAS_SYS (readlink
, ssize_t
,
1973 (const char *restrict file
,
1974 char *restrict buf
, size_t bufsize
));
1976 _GL_CXXALIASWARN (readlink
);
1977 #elif defined GNULIB_POSIXCHECK
1979 # if HAVE_RAW_DECL_READLINK
1980 _GL_WARN_ON_USE (readlink
, "readlink is unportable - "
1981 "use gnulib module readlink for portability");
1986 #if @GNULIB_READLINKAT@
1987 # if @REPLACE_READLINKAT@
1988 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1989 # define readlinkat rpl_readlinkat
1991 _GL_FUNCDECL_RPL (readlinkat
, ssize_t
,
1992 (int fd
, char const *restrict file
,
1993 char *restrict buf
, size_t len
)
1994 _GL_ARG_NONNULL ((2, 3)));
1995 _GL_CXXALIAS_RPL (readlinkat
, ssize_t
,
1996 (int fd
, char const *restrict file
,
1997 char *restrict buf
, size_t len
));
1999 # if !@HAVE_READLINKAT@
2000 _GL_FUNCDECL_SYS (readlinkat
, ssize_t
,
2001 (int fd
, char const *restrict file
,
2002 char *restrict buf
, size_t len
)
2003 _GL_ARG_NONNULL ((2, 3)));
2005 _GL_CXXALIAS_SYS (readlinkat
, ssize_t
,
2006 (int fd
, char const *restrict file
,
2007 char *restrict buf
, size_t len
));
2010 _GL_CXXALIASWARN (readlinkat
);
2012 #elif defined GNULIB_POSIXCHECK
2014 # if HAVE_RAW_DECL_READLINKAT
2015 _GL_WARN_ON_USE (readlinkat
, "readlinkat is not portable - "
2016 "use gnulib module readlinkat for portability");
2022 /* Remove the directory DIR. */
2023 # if @REPLACE_RMDIR@
2024 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2025 # define rmdir rpl_rmdir
2027 _GL_FUNCDECL_RPL (rmdir
, int, (char const *name
) _GL_ARG_NONNULL ((1)));
2028 _GL_CXXALIAS_RPL (rmdir
, int, (char const *name
));
2029 # elif defined _WIN32 && !defined __CYGWIN__
2030 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2032 # define rmdir _rmdir
2034 _GL_CXXALIAS_MDA (rmdir
, int, (char const *name
));
2036 _GL_CXXALIAS_SYS (rmdir
, int, (char const *name
));
2038 _GL_CXXALIASWARN (rmdir
);
2039 #elif defined GNULIB_POSIXCHECK
2041 # if HAVE_RAW_DECL_RMDIR
2042 _GL_WARN_ON_USE (rmdir
, "rmdir is unportable - "
2043 "use gnulib module rmdir for portability");
2045 #elif @GNULIB_MDA_RMDIR@
2046 /* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not
2047 required. In C++ with GNULIB_NAMESPACE, avoid differences between
2048 platforms by defining GNULIB_NAMESPACE::rmdir always. */
2049 # if defined _WIN32 && !defined __CYGWIN__
2050 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2052 # define rmdir _rmdir
2054 _GL_CXXALIAS_MDA (rmdir
, int, (char const *name
));
2056 _GL_CXXALIAS_SYS (rmdir
, int, (char const *name
));
2058 _GL_CXXALIASWARN (rmdir
);
2062 #if @GNULIB_SETHOSTNAME@
2063 /* Set the host name of the machine.
2064 The host name may or may not be fully qualified.
2066 Put LEN bytes of NAME into the host name.
2067 Return 0 if successful, otherwise, set errno and return -1.
2069 Platforms with no ability to set the hostname return -1 and set
2071 # if @REPLACE_SETHOSTNAME@
2072 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2074 # define sethostname rpl_sethostname
2076 _GL_FUNCDECL_RPL (sethostname
, int, (const char *name
, size_t len
)
2077 _GL_ARG_NONNULL ((1)));
2078 _GL_CXXALIAS_RPL (sethostname
, int, (const char *name
, size_t len
));
2080 # if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
2081 _GL_FUNCDECL_SYS (sethostname
, int, (const char *name
, size_t len
)
2082 _GL_ARG_NONNULL ((1)));
2084 /* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
2085 and FreeBSD 6.4 the second parameter is int. On Solaris 11
2086 2011-10, the first parameter is not const. */
2087 _GL_CXXALIAS_SYS_CAST (sethostname
, int, (const char *name
, size_t len
));
2090 _GL_CXXALIASWARN (sethostname
);
2092 #elif defined GNULIB_POSIXCHECK
2094 # if HAVE_RAW_DECL_SETHOSTNAME
2095 _GL_WARN_ON_USE (sethostname
, "sethostname is unportable - "
2096 "use gnulib module sethostname for portability");
2102 /* Pause the execution of the current thread for N seconds.
2103 Returns the number of seconds left to sleep.
2104 See the POSIX:2008 specification
2105 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */
2106 # if @REPLACE_SLEEP@
2107 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2109 # define sleep rpl_sleep
2111 _GL_FUNCDECL_RPL (sleep
, unsigned int, (unsigned int n
));
2112 _GL_CXXALIAS_RPL (sleep
, unsigned int, (unsigned int n
));
2115 _GL_FUNCDECL_SYS (sleep
, unsigned int, (unsigned int n
));
2117 _GL_CXXALIAS_SYS (sleep
, unsigned int, (unsigned int n
));
2119 _GL_CXXALIASWARN (sleep
);
2120 #elif defined GNULIB_POSIXCHECK
2122 # if HAVE_RAW_DECL_SLEEP
2123 _GL_WARN_ON_USE (sleep
, "sleep is unportable - "
2124 "use gnulib module sleep for portability");
2129 #if @GNULIB_MDA_SWAB@
2130 /* On native Windows, map 'swab' to '_swab', so that -loldnames is not
2131 required. In C++ with GNULIB_NAMESPACE, avoid differences between
2132 platforms by defining GNULIB_NAMESPACE::swab always. */
2133 # if defined _WIN32 && !defined __CYGWIN__
2134 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2138 /* Need to cast, because in old mingw the arguments are
2139 (const char *from, char *to, size_t n). */
2140 _GL_CXXALIAS_MDA_CAST (swab
, void, (char *from
, char *to
, int n
));
2142 # if defined __hpux /* HP-UX */
2143 _GL_CXXALIAS_SYS (swab
, void, (const char *from
, char *to
, int n
));
2144 # elif defined __sun && (defined __SunOS_5_10 || defined __XOPEN_OR_POSIX) && !defined _XPG4 /* Solaris */
2145 _GL_CXXALIAS_SYS (swab
, void, (const char *from
, char *to
, ssize_t n
));
2147 _GL_CXXALIAS_SYS (swab
, void, (const void *from
, void *to
, ssize_t n
));
2150 _GL_CXXALIASWARN (swab
);
2154 #if @GNULIB_SYMLINK@
2155 # if @REPLACE_SYMLINK@
2156 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2158 # define symlink rpl_symlink
2160 _GL_FUNCDECL_RPL (symlink
, int, (char const *contents
, char const *file
)
2161 _GL_ARG_NONNULL ((1, 2)));
2162 _GL_CXXALIAS_RPL (symlink
, int, (char const *contents
, char const *file
));
2164 # if !@HAVE_SYMLINK@
2165 _GL_FUNCDECL_SYS (symlink
, int, (char const *contents
, char const *file
)
2166 _GL_ARG_NONNULL ((1, 2)));
2168 _GL_CXXALIAS_SYS (symlink
, int, (char const *contents
, char const *file
));
2170 _GL_CXXALIASWARN (symlink
);
2171 #elif defined GNULIB_POSIXCHECK
2173 # if HAVE_RAW_DECL_SYMLINK
2174 _GL_WARN_ON_USE (symlink
, "symlink is not portable - "
2175 "use gnulib module symlink for portability");
2180 #if @GNULIB_SYMLINKAT@
2181 # if @REPLACE_SYMLINKAT@
2182 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2184 # define symlinkat rpl_symlinkat
2186 _GL_FUNCDECL_RPL (symlinkat
, int,
2187 (char const *contents
, int fd
, char const *file
)
2188 _GL_ARG_NONNULL ((1, 3)));
2189 _GL_CXXALIAS_RPL (symlinkat
, int,
2190 (char const *contents
, int fd
, char const *file
));
2192 # if !@HAVE_SYMLINKAT@
2193 _GL_FUNCDECL_SYS (symlinkat
, int,
2194 (char const *contents
, int fd
, char const *file
)
2195 _GL_ARG_NONNULL ((1, 3)));
2197 _GL_CXXALIAS_SYS (symlinkat
, int,
2198 (char const *contents
, int fd
, char const *file
));
2201 _GL_CXXALIASWARN (symlinkat
);
2203 #elif defined GNULIB_POSIXCHECK
2205 # if HAVE_RAW_DECL_SYMLINKAT
2206 _GL_WARN_ON_USE (symlinkat
, "symlinkat is not portable - "
2207 "use gnulib module symlinkat for portability");
2212 #if @GNULIB_TRUNCATE@
2213 /* Change the size of the file designated by FILENAME to become equal to LENGTH.
2214 Return 0 if successful, otherwise -1 and errno set.
2215 See the POSIX:2008 specification
2216 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>. */
2217 # if @REPLACE_TRUNCATE@
2218 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2220 # define truncate rpl_truncate
2222 _GL_FUNCDECL_RPL (truncate
, int, (const char *filename
, off_t length
)
2223 _GL_ARG_NONNULL ((1)));
2224 _GL_CXXALIAS_RPL (truncate
, int, (const char *filename
, off_t length
));
2226 # if !@HAVE_DECL_TRUNCATE@
2227 _GL_FUNCDECL_SYS (truncate
, int, (const char *filename
, off_t length
)
2228 _GL_ARG_NONNULL ((1)));
2230 _GL_CXXALIAS_SYS (truncate
, int, (const char *filename
, off_t length
));
2233 _GL_CXXALIASWARN (truncate
);
2235 #elif defined GNULIB_POSIXCHECK
2237 # if HAVE_RAW_DECL_TRUNCATE
2238 _GL_WARN_ON_USE (truncate
, "truncate is unportable - "
2239 "use gnulib module truncate for portability");
2244 #if @GNULIB_TTYNAME_R@
2245 /* Store at most BUFLEN characters of the pathname of the terminal FD is
2246 open on in BUF. Return 0 on success, otherwise an error number. */
2247 # if @REPLACE_TTYNAME_R@
2248 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2250 # define ttyname_r rpl_ttyname_r
2252 _GL_FUNCDECL_RPL (ttyname_r
, int,
2253 (int fd
, char *buf
, size_t buflen
) _GL_ARG_NONNULL ((2)));
2254 _GL_CXXALIAS_RPL (ttyname_r
, int,
2255 (int fd
, char *buf
, size_t buflen
));
2257 # if !@HAVE_DECL_TTYNAME_R@
2258 _GL_FUNCDECL_SYS (ttyname_r
, int,
2259 (int fd
, char *buf
, size_t buflen
) _GL_ARG_NONNULL ((2)));
2261 _GL_CXXALIAS_SYS (ttyname_r
, int,
2262 (int fd
, char *buf
, size_t buflen
));
2265 _GL_CXXALIASWARN (ttyname_r
);
2267 #elif defined GNULIB_POSIXCHECK
2269 # if HAVE_RAW_DECL_TTYNAME_R
2270 _GL_WARN_ON_USE (ttyname_r
, "ttyname_r is not portable - "
2271 "use gnulib module ttyname_r for portability");
2277 # if @REPLACE_UNLINK@
2278 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2280 # define unlink rpl_unlink
2282 _GL_FUNCDECL_RPL (unlink
, int, (char const *file
) _GL_ARG_NONNULL ((1)));
2283 _GL_CXXALIAS_RPL (unlink
, int, (char const *file
));
2284 # elif defined _WIN32 && !defined __CYGWIN__
2285 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2287 # define unlink _unlink
2289 _GL_CXXALIAS_MDA (unlink
, int, (char const *file
));
2291 _GL_CXXALIAS_SYS (unlink
, int, (char const *file
));
2293 _GL_CXXALIASWARN (unlink
);
2294 #elif defined GNULIB_POSIXCHECK
2296 # if HAVE_RAW_DECL_UNLINK
2297 _GL_WARN_ON_USE (unlink
, "unlink is not portable - "
2298 "use gnulib module unlink for portability");
2300 #elif @GNULIB_MDA_UNLINK@
2301 /* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not
2302 required. In C++ with GNULIB_NAMESPACE, avoid differences between
2303 platforms by defining GNULIB_NAMESPACE::unlink always. */
2304 # if defined _WIN32 && !defined __CYGWIN__
2305 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2307 # define unlink _unlink
2309 _GL_CXXALIAS_MDA (unlink
, int, (char const *file
));
2311 _GL_CXXALIAS_SYS (unlink
, int, (char const *file
));
2313 _GL_CXXALIASWARN (unlink
);
2317 #if @GNULIB_UNLINKAT@
2318 # if @REPLACE_UNLINKAT@
2319 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2321 # define unlinkat rpl_unlinkat
2323 _GL_FUNCDECL_RPL (unlinkat
, int, (int fd
, char const *file
, int flag
)
2324 _GL_ARG_NONNULL ((2)));
2325 _GL_CXXALIAS_RPL (unlinkat
, int, (int fd
, char const *file
, int flag
));
2327 # if !@HAVE_UNLINKAT@
2328 _GL_FUNCDECL_SYS (unlinkat
, int, (int fd
, char const *file
, int flag
)
2329 _GL_ARG_NONNULL ((2)));
2331 _GL_CXXALIAS_SYS (unlinkat
, int, (int fd
, char const *file
, int flag
));
2333 _GL_CXXALIASWARN (unlinkat
);
2334 #elif defined GNULIB_POSIXCHECK
2336 # if HAVE_RAW_DECL_UNLINKAT
2337 _GL_WARN_ON_USE (unlinkat
, "unlinkat is not portable - "
2338 "use gnulib module unlinkat for portability");
2344 /* Pause the execution of the current thread for N microseconds.
2345 Returns 0 on completion, or -1 on range error.
2346 See the POSIX:2001 specification
2347 <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>. */
2348 # if @REPLACE_USLEEP@
2349 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2351 # define usleep rpl_usleep
2353 _GL_FUNCDECL_RPL (usleep
, int, (useconds_t n
));
2354 _GL_CXXALIAS_RPL (usleep
, int, (useconds_t n
));
2357 _GL_FUNCDECL_SYS (usleep
, int, (useconds_t n
));
2359 /* Need to cast, because on Haiku, the first parameter is
2361 _GL_CXXALIAS_SYS_CAST (usleep
, int, (useconds_t n
));
2363 _GL_CXXALIASWARN (usleep
);
2364 #elif defined GNULIB_POSIXCHECK
2366 # if HAVE_RAW_DECL_USLEEP
2367 _GL_WARN_ON_USE (usleep
, "usleep is unportable - "
2368 "use gnulib module usleep for portability");
2374 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
2375 See the POSIX:2008 specification
2376 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */
2377 # if @REPLACE_WRITE@
2378 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2380 # define write rpl_write
2382 _GL_FUNCDECL_RPL (write
, ssize_t
, (int fd
, const void *buf
, size_t count
)
2383 _GL_ARG_NONNULL ((2)));
2384 _GL_CXXALIAS_RPL (write
, ssize_t
, (int fd
, const void *buf
, size_t count
));
2385 # elif defined _WIN32 && !defined __CYGWIN__
2386 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2388 # define write _write
2390 _GL_CXXALIAS_MDA (write
, ssize_t
, (int fd
, const void *buf
, size_t count
));
2392 _GL_CXXALIAS_SYS (write
, ssize_t
, (int fd
, const void *buf
, size_t count
));
2394 _GL_CXXALIASWARN (write
);
2395 #elif @GNULIB_MDA_WRITE@
2396 /* On native Windows, map 'write' to '_write', so that -loldnames is not
2397 required. In C++ with GNULIB_NAMESPACE, avoid differences between
2398 platforms by defining GNULIB_NAMESPACE::write always. */
2399 # if defined _WIN32 && !defined __CYGWIN__
2400 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2402 # define write _write
2405 _GL_CXXALIAS_MDA (write
, int, (int fd
, const void *buf
, unsigned int count
));
2407 _GL_CXXALIAS_MDA (write
, ssize_t
, (int fd
, const void *buf
, unsigned int count
));
2410 _GL_CXXALIAS_SYS (write
, ssize_t
, (int fd
, const void *buf
, size_t count
));
2412 _GL_CXXALIASWARN (write
);
2415 _GL_INLINE_HEADER_END
2417 #endif /* _@GUARD_PREFIX@_UNISTD_H */
2418 #endif /* _GL_INCLUDING_UNISTD_H */
2419 #endif /* _@GUARD_PREFIX@_UNISTD_H */