summaryrefslogtreecommitdiffstats
path: root/gl/unistd.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/unistd.in.h')
-rw-r--r--gl/unistd.in.h526
1 files changed, 277 insertions, 249 deletions
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index b4129663..f7e4450c 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -1,5 +1,5 @@
1/* Substitute for and wrapper around <unistd.h>. 1/* Substitute for and wrapper around <unistd.h>.
2 Copyright (C) 2003-2024 Free Software Foundation, Inc. 2 Copyright (C) 2003-2026 Free Software Foundation, Inc.
3 3
4 This file is free software: you can redistribute it and/or modify 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 5 it under the terms of the GNU Lesser General Public License as
@@ -69,8 +69,8 @@
69#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H 69#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
70#define _@GUARD_PREFIX@_UNISTD_H 70#define _@GUARD_PREFIX@_UNISTD_H
71 71
72/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK, 72/* This file uses _GL_ATTRIBUTE_NODISCARD, _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
73 HAVE_RAW_DECL_*. */ 73 GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
74#if !_GL_CONFIG_H_INCLUDED 74#if !_GL_CONFIG_H_INCLUDED
75 #error "Please include config.h first." 75 #error "Please include config.h first."
76#endif 76#endif
@@ -95,12 +95,21 @@
95# include <stdio.h> 95# include <stdio.h>
96#endif 96#endif
97 97
98/* Native Windows platforms declare _chdir, _getcwd, _rmdir in
99 <io.h> and/or <direct.h>, not in <unistd.h>.
100 They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(),
101 _lseek(), _read(), _unlink(), _write() in <io.h>. */
102#if defined _WIN32 && !defined __CYGWIN__
103# include <io.h>
104# include <direct.h>
105#endif
106
98/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in 107/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in
99 <unistd.h>. */ 108 <unistd.h>. */
100/* But avoid namespace pollution on glibc systems. */ 109/* But avoid namespace pollution on glibc systems. */
101#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \ 110#if ((@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \
102 && (defined __CYGWIN__ || defined __ANDROID__) \ 111 && (defined __CYGWIN__ || defined __ANDROID__) \
103 && ! defined __GLIBC__ 112 && ! defined __GLIBC__)
104# include <fcntl.h> 113# include <fcntl.h>
105#endif 114#endif
106 115
@@ -108,33 +117,22 @@
108/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in 117/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
109 <unistd.h>. */ 118 <unistd.h>. */
110/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */ 119/* 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
112 included here. */
113/* But avoid namespace pollution on glibc systems. */ 120/* But avoid namespace pollution on glibc systems. */
114#if !defined __GLIBC__ && !defined __osf__ 121#if !defined __GLIBC__
115# define __need_system_stdlib_h 122# define __need_system_stdlib_h
116# include <stdlib.h> 123# include <stdlib.h>
117# undef __need_system_stdlib_h 124# undef __need_system_stdlib_h
118#endif 125#endif
119 126
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__
125# include <io.h>
126# include <direct.h>
127#endif
128
129/* Native Windows platforms declare _execl*, _execv* in <process.h>. */ 127/* Native Windows platforms declare _execl*, _execv* in <process.h>. */
130#if defined _WIN32 && !defined __CYGWIN__ 128#if defined _WIN32 && !defined __CYGWIN__
131# include <process.h> 129# include <process.h>
132#endif 130#endif
133 131
134/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>. 132/* AIX declares getdomainname in <netdb.h>, not in <unistd.h>.
135 NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */ 133 NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */
136/* But avoid namespace pollution on glibc systems. */ 134/* But avoid namespace pollution on glibc systems. */
137#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \ 135#if ((@GNULIB_GETDOMAINNAME@ && defined _AIX) \
138 || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \ 136 || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
139 && !defined __GLIBC__ 137 && !defined __GLIBC__
140# include <netdb.h> 138# include <netdb.h>
@@ -159,8 +157,9 @@
159#endif 157#endif
160 158
161/* MSVC defines off_t in <sys/types.h>. 159/* MSVC defines off_t in <sys/types.h>.
162 May also define off_t to a 64-bit type on native Windows. */ 160 May also define off_t to a 64-bit type on native Windows.
163/* Get off_t, ssize_t, mode_t. */ 161 Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */
162/* Get off_t, off64_t, ssize_t, mode_t. */
164#include <sys/types.h> 163#include <sys/types.h>
165 164
166/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ 165/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
@@ -180,6 +179,9 @@ _GL_INLINE_HEADER_BEGIN
180#ifndef _GL_UNISTD_INLINE 179#ifndef _GL_UNISTD_INLINE
181# define _GL_UNISTD_INLINE _GL_INLINE 180# define _GL_UNISTD_INLINE _GL_INLINE
182#endif 181#endif
182#ifndef _GL_GETPAGESIZE_INLINE
183# define _GL_GETPAGESIZE_INLINE _GL_INLINE
184#endif
183 185
184/* Hide some function declarations from <winsock2.h>. */ 186/* Hide some function declarations from <winsock2.h>. */
185 187
@@ -286,7 +288,7 @@ _GL_INLINE_HEADER_BEGIN
286# undef access 288# undef access
287# define access rpl_access 289# define access rpl_access
288# endif 290# endif
289_GL_FUNCDECL_RPL (access, int, (const char *file, int mode) 291_GL_FUNCDECL_RPL (access, int, (const char *file, int mode),
290 _GL_ARG_NONNULL ((1))); 292 _GL_ARG_NONNULL ((1)));
291_GL_CXXALIAS_RPL (access, int, (const char *file, int mode)); 293_GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
292# elif defined _WIN32 && !defined __CYGWIN__ 294# elif defined _WIN32 && !defined __CYGWIN__
@@ -300,7 +302,6 @@ _GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
300# endif 302# endif
301_GL_CXXALIASWARN (access); 303_GL_CXXALIASWARN (access);
302#elif defined GNULIB_POSIXCHECK 304#elif defined GNULIB_POSIXCHECK
303# undef access
304# if HAVE_RAW_DECL_ACCESS 305# if HAVE_RAW_DECL_ACCESS
305/* The access() function is a security risk. */ 306/* The access() function is a security risk. */
306_GL_WARN_ON_USE (access, "access does not always support X_OK - " 307_GL_WARN_ON_USE (access, "access does not always support X_OK - "
@@ -337,9 +338,8 @@ _GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
337# endif 338# endif
338_GL_CXXALIASWARN (chdir); 339_GL_CXXALIASWARN (chdir);
339#elif defined GNULIB_POSIXCHECK 340#elif defined GNULIB_POSIXCHECK
340# undef chdir
341# if HAVE_RAW_DECL_CHDIR 341# if HAVE_RAW_DECL_CHDIR
342_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - " 342_GL_WARN_ON_USE (chdir, "chdir is not always in <unistd.h> - "
343 "use gnulib module chdir for portability"); 343 "use gnulib module chdir for portability");
344# endif 344# endif
345#elif @GNULIB_MDA_CHDIR@ 345#elif @GNULIB_MDA_CHDIR@
@@ -370,19 +370,18 @@ _GL_CXXALIASWARN (chdir);
370# undef chown 370# undef chown
371# define chown rpl_chown 371# define chown rpl_chown
372# endif 372# endif
373_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid) 373_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid),
374 _GL_ARG_NONNULL ((1))); 374 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
375_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)); 375_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
376# else 376# else
377# if !@HAVE_CHOWN@ 377# if !@HAVE_CHOWN@
378_GL_FUNCDECL_SYS (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))); 379 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
380# endif 380# endif
381_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)); 381_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
382# endif 382# endif
383_GL_CXXALIASWARN (chown); 383_GL_CXXALIASWARN (chown);
384#elif defined GNULIB_POSIXCHECK 384#elif defined GNULIB_POSIXCHECK
385# undef chown
386# if HAVE_RAW_DECL_CHOWN 385# if HAVE_RAW_DECL_CHOWN
387_GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and " 386_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 - " 387 "doesn't treat a uid or gid of -1 on some systems - "
@@ -398,7 +397,7 @@ _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
398# undef close 397# undef close
399# define close rpl_close 398# define close rpl_close
400# endif 399# endif
401_GL_FUNCDECL_RPL (close, int, (int fd)); 400_GL_FUNCDECL_RPL (close, int, (int fd), );
402_GL_CXXALIAS_RPL (close, int, (int fd)); 401_GL_CXXALIAS_RPL (close, int, (int fd));
403# elif defined _WIN32 && !defined __CYGWIN__ 402# elif defined _WIN32 && !defined __CYGWIN__
404# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 403# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -411,10 +410,11 @@ _GL_CXXALIAS_SYS (close, int, (int fd));
411# endif 410# endif
412_GL_CXXALIASWARN (close); 411_GL_CXXALIASWARN (close);
413#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ 412#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
414# undef close 413# if !GNULIB_CLOSE
415# define close close_used_without_requesting_gnulib_module_close 414# undef close
415# define close close_used_without_requesting_gnulib_module_close
416# endif
416#elif defined GNULIB_POSIXCHECK 417#elif defined GNULIB_POSIXCHECK
417# undef close
418/* Assume close is always declared. */ 418/* Assume close is always declared. */
419_GL_WARN_ON_USE (close, "close does not portably work on sockets - " 419_GL_WARN_ON_USE (close, "close does not portably work on sockets - "
420 "use gnulib module close for portability"); 420 "use gnulib module close for portability");
@@ -443,7 +443,7 @@ _GL_CXXALIASWARN (close);
443# endif 443# endif
444_GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, 444_GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
445 int ofd, off_t *opos, 445 int ofd, off_t *opos,
446 size_t len, unsigned flags)); 446 size_t len, unsigned flags), );
447_GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, 447_GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
448 int ofd, off_t *opos, 448 int ofd, off_t *opos,
449 size_t len, unsigned flags)); 449 size_t len, unsigned flags));
@@ -451,15 +451,16 @@ _GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
451# if !@HAVE_COPY_FILE_RANGE@ 451# if !@HAVE_COPY_FILE_RANGE@
452_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, 452_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
453 int ofd, off_t *opos, 453 int ofd, off_t *opos,
454 size_t len, unsigned flags)); 454 size_t len, unsigned flags), );
455# endif 455# endif
456_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, 456_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
457 int ofd, off_t *opos, 457 int ofd, off_t *opos,
458 size_t len, unsigned flags)); 458 size_t len, unsigned flags));
459# endif 459# endif
460# if __GLIBC__ >= 2
460_GL_CXXALIASWARN (copy_file_range); 461_GL_CXXALIASWARN (copy_file_range);
462# endif
461#elif defined GNULIB_POSIXCHECK 463#elif defined GNULIB_POSIXCHECK
462# undef copy_file_range
463# if HAVE_RAW_DECL_COPY_FILE_RANGE 464# if HAVE_RAW_DECL_COPY_FILE_RANGE
464_GL_WARN_ON_USE (copy_file_range, 465_GL_WARN_ON_USE (copy_file_range,
465 "copy_file_range is unportable - " 466 "copy_file_range is unportable - "
@@ -473,7 +474,7 @@ _GL_WARN_ON_USE (copy_file_range,
473# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 474# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
474# define dup rpl_dup 475# define dup rpl_dup
475# endif 476# endif
476_GL_FUNCDECL_RPL (dup, int, (int oldfd)); 477_GL_FUNCDECL_RPL (dup, int, (int oldfd), _GL_ATTRIBUTE_NODISCARD);
477_GL_CXXALIAS_RPL (dup, int, (int oldfd)); 478_GL_CXXALIAS_RPL (dup, int, (int oldfd));
478# elif defined _WIN32 && !defined __CYGWIN__ 479# elif defined _WIN32 && !defined __CYGWIN__
479# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 480# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -486,7 +487,6 @@ _GL_CXXALIAS_SYS (dup, int, (int oldfd));
486# endif 487# endif
487_GL_CXXALIASWARN (dup); 488_GL_CXXALIASWARN (dup);
488#elif defined GNULIB_POSIXCHECK 489#elif defined GNULIB_POSIXCHECK
489# undef dup
490# if HAVE_RAW_DECL_DUP 490# if HAVE_RAW_DECL_DUP
491_GL_WARN_ON_USE (dup, "dup is unportable - " 491_GL_WARN_ON_USE (dup, "dup is unportable - "
492 "use gnulib module dup for portability"); 492 "use gnulib module dup for portability");
@@ -518,7 +518,7 @@ _GL_CXXALIASWARN (dup);
518# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 518# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
519# define dup2 rpl_dup2 519# define dup2 rpl_dup2
520# endif 520# endif
521_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd)); 521_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd), );
522_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd)); 522_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
523# elif defined _WIN32 && !defined __CYGWIN__ 523# elif defined _WIN32 && !defined __CYGWIN__
524# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 524# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -531,7 +531,6 @@ _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
531# endif 531# endif
532_GL_CXXALIASWARN (dup2); 532_GL_CXXALIASWARN (dup2);
533#elif defined GNULIB_POSIXCHECK 533#elif defined GNULIB_POSIXCHECK
534# undef dup2
535# if HAVE_RAW_DECL_DUP2 534# if HAVE_RAW_DECL_DUP2
536_GL_WARN_ON_USE (dup2, "dup2 is unportable - " 535_GL_WARN_ON_USE (dup2, "dup2 is unportable - "
537 "use gnulib module dup2 for portability"); 536 "use gnulib module dup2 for portability");
@@ -567,11 +566,11 @@ _GL_CXXALIASWARN (dup2);
567# undef dup3 566# undef dup3
568# define dup3 rpl_dup3 567# define dup3 rpl_dup3
569# endif 568# endif
570_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags)); 569_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags), );
571_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags)); 570_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
572# else 571# else
573# if !@HAVE_DUP3@ 572# if !@HAVE_DUP3@
574_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags)); 573_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags), );
575# endif 574# endif
576_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags)); 575_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
577# endif 576# endif
@@ -579,7 +578,6 @@ _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
579_GL_CXXALIASWARN (dup3); 578_GL_CXXALIASWARN (dup3);
580# endif 579# endif
581#elif defined GNULIB_POSIXCHECK 580#elif defined GNULIB_POSIXCHECK
582# undef dup3
583# if HAVE_RAW_DECL_DUP3 581# if HAVE_RAW_DECL_DUP3
584_GL_WARN_ON_USE (dup3, "dup3 is unportable - " 582_GL_WARN_ON_USE (dup3, "dup3 is unportable - "
585 "use gnulib module dup3 for portability"); 583 "use gnulib module dup3 for portability");
@@ -636,7 +634,7 @@ rpl_environ (void)
636/* Like access(), except that it uses the effective user id and group id of 634/* Like access(), except that it uses the effective user id and group id of
637 the current process. */ 635 the current process. */
638# if !@HAVE_EUIDACCESS@ 636# if !@HAVE_EUIDACCESS@
639_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode) 637_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode),
640 _GL_ARG_NONNULL ((1))); 638 _GL_ARG_NONNULL ((1)));
641# endif 639# endif
642_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode)); 640_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
@@ -647,7 +645,6 @@ _GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
647 "use the gnulib module faccessat instead"); 645 "use the gnulib module faccessat instead");
648# endif 646# endif
649#elif defined GNULIB_POSIXCHECK 647#elif defined GNULIB_POSIXCHECK
650# undef euidaccess
651# if HAVE_RAW_DECL_EUIDACCESS 648# if HAVE_RAW_DECL_EUIDACCESS
652_GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - " 649_GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
653 "use gnulib module euidaccess for portability"); 650 "use gnulib module euidaccess for portability");
@@ -661,7 +658,7 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
661# undef execl 658# undef execl
662# define execl rpl_execl 659# define execl rpl_execl
663# endif 660# endif
664_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...) 661_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...),
665 _GL_ARG_NONNULL ((1))); 662 _GL_ARG_NONNULL ((1)));
666_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...)); 663_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...));
667# else 664# else
@@ -669,7 +666,6 @@ _GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
669# endif 666# endif
670_GL_CXXALIASWARN (execl); 667_GL_CXXALIASWARN (execl);
671#elif defined GNULIB_POSIXCHECK 668#elif defined GNULIB_POSIXCHECK
672# undef execl
673# if HAVE_RAW_DECL_EXECL 669# if HAVE_RAW_DECL_EXECL
674_GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - " 670_GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - "
675 "use gnulib module execl for portability"); 671 "use gnulib module execl for portability");
@@ -696,7 +692,7 @@ _GL_CXXALIASWARN (execl);
696# undef execle 692# undef execle
697# define execle rpl_execle 693# define execle rpl_execle
698# endif 694# endif
699_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...) 695_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...),
700 _GL_ARG_NONNULL ((1))); 696 _GL_ARG_NONNULL ((1)));
701_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...)); 697_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...));
702# else 698# else
@@ -704,7 +700,6 @@ _GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
704# endif 700# endif
705_GL_CXXALIASWARN (execle); 701_GL_CXXALIASWARN (execle);
706#elif defined GNULIB_POSIXCHECK 702#elif defined GNULIB_POSIXCHECK
707# undef execle
708# if HAVE_RAW_DECL_EXECLE 703# if HAVE_RAW_DECL_EXECLE
709_GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - " 704_GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - "
710 "use gnulib module execle for portability"); 705 "use gnulib module execle for portability");
@@ -732,7 +727,7 @@ _GL_CXXALIASWARN (execle);
732# undef execlp 727# undef execlp
733# define execlp rpl_execlp 728# define execlp rpl_execlp
734# endif 729# endif
735_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...) 730_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...),
736 _GL_ARG_NONNULL ((1))); 731 _GL_ARG_NONNULL ((1)));
737_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...)); 732_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...));
738# else 733# else
@@ -740,7 +735,6 @@ _GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
740# endif 735# endif
741_GL_CXXALIASWARN (execlp); 736_GL_CXXALIASWARN (execlp);
742#elif defined GNULIB_POSIXCHECK 737#elif defined GNULIB_POSIXCHECK
743# undef execlp
744# if HAVE_RAW_DECL_EXECLP 738# if HAVE_RAW_DECL_EXECLP
745_GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - " 739_GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - "
746 "use gnulib module execlp for portability"); 740 "use gnulib module execlp for portability");
@@ -769,7 +763,7 @@ _GL_CXXALIASWARN (execlp);
769# undef execv 763# undef execv
770# define execv rpl_execv 764# define execv rpl_execv
771# endif 765# endif
772_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv) 766_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv),
773 _GL_ARG_NONNULL ((1, 2))); 767 _GL_ARG_NONNULL ((1, 2)));
774_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv)); 768_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv));
775# else 769# else
@@ -777,7 +771,6 @@ _GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
777# endif 771# endif
778_GL_CXXALIASWARN (execv); 772_GL_CXXALIASWARN (execv);
779#elif defined GNULIB_POSIXCHECK 773#elif defined GNULIB_POSIXCHECK
780# undef execv
781# if HAVE_RAW_DECL_EXECV 774# if HAVE_RAW_DECL_EXECV
782_GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - " 775_GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - "
783 "use gnulib module execv for portability"); 776 "use gnulib module execv for portability");
@@ -806,7 +799,7 @@ _GL_CXXALIASWARN (execv);
806# define execve rpl_execve 799# define execve rpl_execve
807# endif 800# endif
808_GL_FUNCDECL_RPL (execve, int, 801_GL_FUNCDECL_RPL (execve, int,
809 (const char *program, char * const *argv, char * const *env) 802 (const char *program, char * const *argv, char * const *env),
810 _GL_ARG_NONNULL ((1, 2))); 803 _GL_ARG_NONNULL ((1, 2)));
811_GL_CXXALIAS_RPL (execve, int, 804_GL_CXXALIAS_RPL (execve, int,
812 (const char *program, char * const *argv, char * const *env)); 805 (const char *program, char * const *argv, char * const *env));
@@ -816,7 +809,6 @@ _GL_CXXALIAS_SYS (execve, int,
816# endif 809# endif
817_GL_CXXALIASWARN (execve); 810_GL_CXXALIASWARN (execve);
818#elif defined GNULIB_POSIXCHECK 811#elif defined GNULIB_POSIXCHECK
819# undef execve
820# if HAVE_RAW_DECL_EXECVE 812# if HAVE_RAW_DECL_EXECVE
821_GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - " 813_GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - "
822 "use gnulib module execve for portability"); 814 "use gnulib module execve for portability");
@@ -846,7 +838,7 @@ _GL_CXXALIASWARN (execve);
846# undef execvp 838# undef execvp
847# define execvp rpl_execvp 839# define execvp rpl_execvp
848# endif 840# endif
849_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv) 841_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv),
850 _GL_ARG_NONNULL ((1, 2))); 842 _GL_ARG_NONNULL ((1, 2)));
851_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv)); 843_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv));
852# else 844# else
@@ -854,7 +846,6 @@ _GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
854# endif 846# endif
855_GL_CXXALIASWARN (execvp); 847_GL_CXXALIASWARN (execvp);
856#elif defined GNULIB_POSIXCHECK 848#elif defined GNULIB_POSIXCHECK
857# undef execvp
858# if HAVE_RAW_DECL_EXECVP 849# if HAVE_RAW_DECL_EXECVP
859_GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - " 850_GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - "
860 "use gnulib module execvp for portability"); 851 "use gnulib module execvp for portability");
@@ -883,14 +874,14 @@ _GL_CXXALIASWARN (execvp);
883# define execvpe rpl_execvpe 874# define execvpe rpl_execvpe
884# endif 875# endif
885_GL_FUNCDECL_RPL (execvpe, int, 876_GL_FUNCDECL_RPL (execvpe, int,
886 (const char *program, char * const *argv, char * const *env) 877 (const char *program, char * const *argv, char * const *env),
887 _GL_ARG_NONNULL ((1, 2))); 878 _GL_ARG_NONNULL ((1, 2)));
888_GL_CXXALIAS_RPL (execvpe, int, 879_GL_CXXALIAS_RPL (execvpe, int,
889 (const char *program, char * const *argv, char * const *env)); 880 (const char *program, char * const *argv, char * const *env));
890# else 881# else
891# if !@HAVE_DECL_EXECVPE@ 882# if !@HAVE_DECL_EXECVPE@
892_GL_FUNCDECL_SYS (execvpe, int, 883_GL_FUNCDECL_SYS (execvpe, int,
893 (const char *program, char * const *argv, char * const *env) 884 (const char *program, char * const *argv, char * const *env),
894 _GL_ARG_NONNULL ((1, 2))); 885 _GL_ARG_NONNULL ((1, 2)));
895# endif 886# endif
896_GL_CXXALIAS_SYS (execvpe, int, 887_GL_CXXALIAS_SYS (execvpe, int,
@@ -900,7 +891,6 @@ _GL_CXXALIAS_SYS (execvpe, int,
900_GL_CXXALIASWARN (execvpe); 891_GL_CXXALIASWARN (execvpe);
901# endif 892# endif
902#elif defined GNULIB_POSIXCHECK 893#elif defined GNULIB_POSIXCHECK
903# undef execvpe
904# if HAVE_RAW_DECL_EXECVPE 894# if HAVE_RAW_DECL_EXECVPE
905_GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - " 895_GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - "
906 "use gnulib module execvpe for portability"); 896 "use gnulib module execvpe for portability");
@@ -921,7 +911,7 @@ _GL_CXXALIAS_MDA_CAST (execvpe, intptr_t,
921# elif @HAVE_EXECVPE@ 911# elif @HAVE_EXECVPE@
922# if !@HAVE_DECL_EXECVPE@ 912# if !@HAVE_DECL_EXECVPE@
923_GL_FUNCDECL_SYS (execvpe, int, 913_GL_FUNCDECL_SYS (execvpe, int,
924 (const char *program, char * const *argv, char * const *env) 914 (const char *program, char * const *argv, char * const *env),
925 _GL_ARG_NONNULL ((1, 2))); 915 _GL_ARG_NONNULL ((1, 2)));
926# endif 916# endif
927_GL_CXXALIAS_SYS (execvpe, int, 917_GL_CXXALIAS_SYS (execvpe, int,
@@ -940,15 +930,15 @@ _GL_CXXALIASWARN (execvpe);
940# define faccessat rpl_faccessat 930# define faccessat rpl_faccessat
941# endif 931# endif
942_GL_FUNCDECL_RPL (faccessat, int, 932_GL_FUNCDECL_RPL (faccessat, int,
943 (int fd, char const *name, int mode, int flag) 933 (int fd, char const *name, int mode, int flag),
944 _GL_ARG_NONNULL ((2))); 934 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
945_GL_CXXALIAS_RPL (faccessat, int, 935_GL_CXXALIAS_RPL (faccessat, int,
946 (int fd, char const *name, int mode, int flag)); 936 (int fd, char const *name, int mode, int flag));
947# else 937# else
948# if !@HAVE_FACCESSAT@ 938# if !@HAVE_FACCESSAT@
949_GL_FUNCDECL_SYS (faccessat, int, 939_GL_FUNCDECL_SYS (faccessat, int,
950 (int fd, char const *file, int mode, int flag) 940 (int fd, char const *file, int mode, int flag),
951 _GL_ARG_NONNULL ((2))); 941 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
952# endif 942# endif
953_GL_CXXALIAS_SYS (faccessat, int, 943_GL_CXXALIAS_SYS (faccessat, int,
954 (int fd, char const *file, int mode, int flag)); 944 (int fd, char const *file, int mode, int flag));
@@ -957,7 +947,6 @@ _GL_CXXALIAS_SYS (faccessat, int,
957_GL_CXXALIASWARN (faccessat); 947_GL_CXXALIASWARN (faccessat);
958# endif 948# endif
959#elif defined GNULIB_POSIXCHECK 949#elif defined GNULIB_POSIXCHECK
960# undef faccessat
961# if HAVE_RAW_DECL_FACCESSAT 950# if HAVE_RAW_DECL_FACCESSAT
962_GL_WARN_ON_USE (faccessat, "faccessat is not portable - " 951_GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
963 "use gnulib module faccessat for portability"); 952 "use gnulib module faccessat for portability");
@@ -976,11 +965,11 @@ _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
976# undef fchdir 965# undef fchdir
977# define fchdir rpl_fchdir 966# define fchdir rpl_fchdir
978# endif 967# endif
979_GL_FUNCDECL_RPL (fchdir, int, (int /*fd*/)); 968_GL_FUNCDECL_RPL (fchdir, int, (int /*fd*/), _GL_ATTRIBUTE_NODISCARD);
980_GL_CXXALIAS_RPL (fchdir, int, (int /*fd*/)); 969_GL_CXXALIAS_RPL (fchdir, int, (int /*fd*/));
981# else 970# else
982# if !@HAVE_FCHDIR@ || !@HAVE_DECL_FCHDIR@ 971# if !@HAVE_FCHDIR@ || !@HAVE_DECL_FCHDIR@
983_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); 972_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/), _GL_ATTRIBUTE_NODISCARD);
984# endif 973# endif
985_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/)); 974_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
986# endif 975# endif
@@ -994,7 +983,6 @@ _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
994_GL_EXTERN_C const char *_gl_directory_name (int fd); 983_GL_EXTERN_C const char *_gl_directory_name (int fd);
995# endif 984# endif
996#elif defined GNULIB_POSIXCHECK 985#elif defined GNULIB_POSIXCHECK
997# undef fchdir
998# if HAVE_RAW_DECL_FCHDIR 986# if HAVE_RAW_DECL_FCHDIR
999_GL_WARN_ON_USE (fchdir, "fchdir is unportable - " 987_GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
1000 "use gnulib module fchdir for portability"); 988 "use gnulib module fchdir for portability");
@@ -1009,22 +997,21 @@ _GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
1009# define fchownat rpl_fchownat 997# define fchownat rpl_fchownat
1010# endif 998# endif
1011_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file, 999_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
1012 uid_t owner, gid_t group, int flag) 1000 uid_t owner, gid_t group, int flag),
1013 _GL_ARG_NONNULL ((2))); 1001 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
1014_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file, 1002_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
1015 uid_t owner, gid_t group, int flag)); 1003 uid_t owner, gid_t group, int flag));
1016# else 1004# else
1017# if !@HAVE_FCHOWNAT@ 1005# if !@HAVE_FCHOWNAT@
1018_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file, 1006_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
1019 uid_t owner, gid_t group, int flag) 1007 uid_t owner, gid_t group, int flag),
1020 _GL_ARG_NONNULL ((2))); 1008 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
1021# endif 1009# endif
1022_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file, 1010_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
1023 uid_t owner, gid_t group, int flag)); 1011 uid_t owner, gid_t group, int flag));
1024# endif 1012# endif
1025_GL_CXXALIASWARN (fchownat); 1013_GL_CXXALIASWARN (fchownat);
1026#elif defined GNULIB_POSIXCHECK 1014#elif defined GNULIB_POSIXCHECK
1027# undef fchownat
1028# if HAVE_RAW_DECL_FCHOWNAT 1015# if HAVE_RAW_DECL_FCHOWNAT
1029_GL_WARN_ON_USE (fchownat, "fchownat is not portable - " 1016_GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
1030 "use gnulib module fchownat for portability"); 1017 "use gnulib module fchownat for portability");
@@ -1042,11 +1029,11 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
1042# undef fdatasync 1029# undef fdatasync
1043# define fdatasync rpl_fdatasync 1030# define fdatasync rpl_fdatasync
1044# endif 1031# endif
1045_GL_FUNCDECL_RPL (fdatasync, int, (int fd)); 1032_GL_FUNCDECL_RPL (fdatasync, int, (int fd), );
1046_GL_CXXALIAS_RPL (fdatasync, int, (int fd)); 1033_GL_CXXALIAS_RPL (fdatasync, int, (int fd));
1047# else 1034# else
1048# if !@HAVE_FDATASYNC@|| !@HAVE_DECL_FDATASYNC@ 1035# if !@HAVE_FDATASYNC@|| !@HAVE_DECL_FDATASYNC@
1049_GL_FUNCDECL_SYS (fdatasync, int, (int fd)); 1036_GL_FUNCDECL_SYS (fdatasync, int, (int fd), );
1050# endif 1037# endif
1051_GL_CXXALIAS_SYS (fdatasync, int, (int fd)); 1038_GL_CXXALIAS_SYS (fdatasync, int, (int fd));
1052# endif 1039# endif
@@ -1054,7 +1041,6 @@ _GL_CXXALIAS_SYS (fdatasync, int, (int fd));
1054_GL_CXXALIASWARN (fdatasync); 1041_GL_CXXALIASWARN (fdatasync);
1055# endif 1042# endif
1056#elif defined GNULIB_POSIXCHECK 1043#elif defined GNULIB_POSIXCHECK
1057# undef fdatasync
1058# if HAVE_RAW_DECL_FDATASYNC 1044# if HAVE_RAW_DECL_FDATASYNC
1059_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - " 1045_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
1060 "use gnulib module fdatasync for portability"); 1046 "use gnulib module fdatasync for portability");
@@ -1068,12 +1054,11 @@ _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
1068 See POSIX:2008 specification 1054 See POSIX:2008 specification
1069 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */ 1055 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */
1070# if !@HAVE_FSYNC@ 1056# if !@HAVE_FSYNC@
1071_GL_FUNCDECL_SYS (fsync, int, (int fd)); 1057_GL_FUNCDECL_SYS (fsync, int, (int fd), );
1072# endif 1058# endif
1073_GL_CXXALIAS_SYS (fsync, int, (int fd)); 1059_GL_CXXALIAS_SYS (fsync, int, (int fd));
1074_GL_CXXALIASWARN (fsync); 1060_GL_CXXALIASWARN (fsync);
1075#elif defined GNULIB_POSIXCHECK 1061#elif defined GNULIB_POSIXCHECK
1076# undef fsync
1077# if HAVE_RAW_DECL_FSYNC 1062# if HAVE_RAW_DECL_FSYNC
1078_GL_WARN_ON_USE (fsync, "fsync is unportable - " 1063_GL_WARN_ON_USE (fsync, "fsync is unportable - "
1079 "use gnulib module fsync for portability"); 1064 "use gnulib module fsync for portability");
@@ -1091,19 +1076,22 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - "
1091# undef ftruncate 1076# undef ftruncate
1092# define ftruncate rpl_ftruncate 1077# define ftruncate rpl_ftruncate
1093# endif 1078# endif
1094_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length)); 1079_GL_FUNCDECL_RPL (ftruncate, int,
1095_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length)); 1080 (int fd, off_t length), _GL_ATTRIBUTE_NODISCARD);
1081_GL_CXXALIAS_RPL (ftruncate, int,
1082 (int fd, off_t length));
1096# else 1083# else
1097# if !@HAVE_FTRUNCATE@ 1084# if !@HAVE_FTRUNCATE@
1098_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length)); 1085_GL_FUNCDECL_SYS (ftruncate, int,
1086 (int fd, off_t length), _GL_ATTRIBUTE_NODISCARD);
1099# endif 1087# endif
1100_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length)); 1088_GL_CXXALIAS_SYS (ftruncate, int,
1089 (int fd, off_t length));
1101# endif 1090# endif
1102# if __GLIBC__ >= 2 1091# if __GLIBC__ >= 2
1103_GL_CXXALIASWARN (ftruncate); 1092_GL_CXXALIASWARN (ftruncate);
1104# endif 1093# endif
1105#elif defined GNULIB_POSIXCHECK 1094#elif defined GNULIB_POSIXCHECK
1106# undef ftruncate
1107# if HAVE_RAW_DECL_FTRUNCATE 1095# if HAVE_RAW_DECL_FTRUNCATE
1108_GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - " 1096_GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
1109 "use gnulib module ftruncate for portability"); 1097 "use gnulib module ftruncate for portability");
@@ -1126,7 +1114,8 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
1126# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1114# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1127# define getcwd rpl_getcwd 1115# define getcwd rpl_getcwd
1128# endif 1116# endif
1129_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size)); 1117_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size),
1118 _GL_ATTRIBUTE_NODISCARD);
1130_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size)); 1119_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
1131# elif defined _WIN32 && !defined __CYGWIN__ 1120# elif defined _WIN32 && !defined __CYGWIN__
1132# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1121# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1141,7 +1130,6 @@ _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
1141# endif 1130# endif
1142_GL_CXXALIASWARN (getcwd); 1131_GL_CXXALIASWARN (getcwd);
1143#elif defined GNULIB_POSIXCHECK 1132#elif defined GNULIB_POSIXCHECK
1144# undef getcwd
1145# if HAVE_RAW_DECL_GETCWD 1133# if HAVE_RAW_DECL_GETCWD
1146_GL_WARN_ON_USE (getcwd, "getcwd is unportable - " 1134_GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
1147 "use gnulib module getcwd for portability"); 1135 "use gnulib module getcwd for portability");
@@ -1181,21 +1169,24 @@ _GL_CXXALIASWARN (getcwd);
1181# undef getdomainname 1169# undef getdomainname
1182# define getdomainname rpl_getdomainname 1170# define getdomainname rpl_getdomainname
1183# endif 1171# endif
1184_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len) 1172_GL_FUNCDECL_RPL (getdomainname, int,
1185 _GL_ARG_NONNULL ((1))); 1173 (char *name, size_t len),
1186_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len)); 1174 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1175_GL_CXXALIAS_RPL (getdomainname, int,
1176 (char *name, size_t len));
1187# else 1177# else
1188# if !@HAVE_DECL_GETDOMAINNAME@ 1178# if !@HAVE_DECL_GETDOMAINNAME@
1189_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len) 1179_GL_FUNCDECL_SYS (getdomainname, int,
1190 _GL_ARG_NONNULL ((1))); 1180 (char *name, size_t len),
1181 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1191# endif 1182# endif
1192_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len)); 1183_GL_CXXALIAS_SYS (getdomainname, int,
1184 (char *name, size_t len));
1193# endif 1185# endif
1194# if __GLIBC__ >= 2 1186# if __GLIBC__ >= 2
1195_GL_CXXALIASWARN (getdomainname); 1187_GL_CXXALIASWARN (getdomainname);
1196# endif 1188# endif
1197#elif defined GNULIB_POSIXCHECK 1189#elif defined GNULIB_POSIXCHECK
1198# undef getdomainname
1199# if HAVE_RAW_DECL_GETDOMAINNAME 1190# if HAVE_RAW_DECL_GETDOMAINNAME
1200_GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - " 1191_GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
1201 "use gnulib module getdomainname for portability"); 1192 "use gnulib module getdomainname for portability");
@@ -1211,11 +1202,11 @@ _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
1211# undef getdtablesize 1202# undef getdtablesize
1212# define getdtablesize rpl_getdtablesize 1203# define getdtablesize rpl_getdtablesize
1213# endif 1204# endif
1214_GL_FUNCDECL_RPL (getdtablesize, int, (void)); 1205_GL_FUNCDECL_RPL (getdtablesize, int, (void), );
1215_GL_CXXALIAS_RPL (getdtablesize, int, (void)); 1206_GL_CXXALIAS_RPL (getdtablesize, int, (void));
1216# else 1207# else
1217# if !@HAVE_GETDTABLESIZE@ 1208# if !@HAVE_GETDTABLESIZE@
1218_GL_FUNCDECL_SYS (getdtablesize, int, (void)); 1209_GL_FUNCDECL_SYS (getdtablesize, int, (void), );
1219# endif 1210# endif
1220/* Need to cast, because on AIX, the parameter list is 1211/* Need to cast, because on AIX, the parameter list is
1221 (...). */ 1212 (...). */
@@ -1223,7 +1214,6 @@ _GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void));
1223# endif 1214# endif
1224_GL_CXXALIASWARN (getdtablesize); 1215_GL_CXXALIASWARN (getdtablesize);
1225#elif defined GNULIB_POSIXCHECK 1216#elif defined GNULIB_POSIXCHECK
1226# undef getdtablesize
1227# if HAVE_RAW_DECL_GETDTABLESIZE 1217# if HAVE_RAW_DECL_GETDTABLESIZE
1228_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - " 1218_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
1229 "use gnulib module getdtablesize for portability"); 1219 "use gnulib module getdtablesize for portability");
@@ -1238,19 +1228,22 @@ _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
1238# undef getentropy 1228# undef getentropy
1239# define getentropy rpl_getentropy 1229# define getentropy rpl_getentropy
1240# endif 1230# endif
1241_GL_FUNCDECL_RPL (getentropy, int, (void *buffer, size_t length)); 1231_GL_FUNCDECL_RPL (getentropy, int,
1242_GL_CXXALIAS_RPL (getentropy, int, (void *buffer, size_t length)); 1232 (void *buffer, size_t length), _GL_ATTRIBUTE_NODISCARD);
1233_GL_CXXALIAS_RPL (getentropy, int,
1234 (void *buffer, size_t length));
1243# else 1235# else
1244# if !@HAVE_GETENTROPY@ 1236# if !@HAVE_GETENTROPY@
1245_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length)); 1237_GL_FUNCDECL_SYS (getentropy, int,
1238 (void *buffer, size_t length), _GL_ATTRIBUTE_NODISCARD);
1246# endif 1239# endif
1247_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length)); 1240_GL_CXXALIAS_SYS (getentropy, int,
1241 (void *buffer, size_t length));
1248# endif 1242# endif
1249# if __GLIBC__ >= 2 1243# if __GLIBC__ >= 2
1250_GL_CXXALIASWARN (getentropy); 1244_GL_CXXALIASWARN (getentropy);
1251# endif 1245# endif
1252#elif defined GNULIB_POSIXCHECK 1246#elif defined GNULIB_POSIXCHECK
1253# undef getentropy
1254# if HAVE_RAW_DECL_GETENTROPY 1247# if HAVE_RAW_DECL_GETENTROPY
1255_GL_WARN_ON_USE (getentropy, "getentropy is unportable - " 1248_GL_WARN_ON_USE (getentropy, "getentropy is unportable - "
1256 "use gnulib module getentropy for portability"); 1249 "use gnulib module getentropy for portability");
@@ -1269,17 +1262,20 @@ _GL_WARN_ON_USE (getentropy, "getentropy is unportable - "
1269# undef getgroups 1262# undef getgroups
1270# define getgroups rpl_getgroups 1263# define getgroups rpl_getgroups
1271# endif 1264# endif
1272_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups)); 1265_GL_FUNCDECL_RPL (getgroups, int,
1273_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups)); 1266 (int n, gid_t *groups), _GL_ATTRIBUTE_NODISCARD);
1267_GL_CXXALIAS_RPL (getgroups, int,
1268 (int n, gid_t *groups));
1274# else 1269# else
1275# if !@HAVE_GETGROUPS@ 1270# if !@HAVE_GETGROUPS@
1276_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups)); 1271_GL_FUNCDECL_SYS (getgroups, int,
1272 (int n, gid_t *groups), _GL_ATTRIBUTE_NODISCARD);
1277# endif 1273# endif
1278_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups)); 1274_GL_CXXALIAS_SYS (getgroups, int,
1275 (int n, gid_t *groups));
1279# endif 1276# endif
1280_GL_CXXALIASWARN (getgroups); 1277_GL_CXXALIASWARN (getgroups);
1281#elif defined GNULIB_POSIXCHECK 1278#elif defined GNULIB_POSIXCHECK
1282# undef getgroups
1283# if HAVE_RAW_DECL_GETGROUPS 1279# if HAVE_RAW_DECL_GETGROUPS
1284_GL_WARN_ON_USE (getgroups, "getgroups is unportable - " 1280_GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
1285 "use gnulib module getgroups for portability"); 1281 "use gnulib module getgroups for portability");
@@ -1300,25 +1296,25 @@ _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
1300# undef gethostname 1296# undef gethostname
1301# define gethostname rpl_gethostname 1297# define gethostname rpl_gethostname
1302# endif 1298# endif
1303_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len) 1299_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len),
1304 _GL_ARG_NONNULL ((1))); 1300 _GL_ARG_NONNULL ((1)));
1305_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len)); 1301_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
1306# else 1302# else
1307# if !@HAVE_GETHOSTNAME@ 1303# if !@HAVE_GETHOSTNAME@
1308_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len) 1304_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len),
1309 _GL_ARG_NONNULL ((1))); 1305 _GL_ARG_NONNULL ((1)));
1310# endif 1306# endif
1311/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second 1307/* Need to cast, because on Solaris 10 systems, the second parameter is
1312 parameter is
1313 int len. */ 1308 int len. */
1314_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len)); 1309_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
1315# endif 1310# endif
1316_GL_CXXALIASWARN (gethostname); 1311_GL_CXXALIASWARN (gethostname);
1317#elif @UNISTD_H_HAVE_WINSOCK2_H@ 1312#elif @UNISTD_H_HAVE_WINSOCK2_H@
1318# undef gethostname 1313# if !GNULIB_GETHOSTNAME
1319# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname 1314# undef gethostname
1315# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
1316# endif
1320#elif defined GNULIB_POSIXCHECK 1317#elif defined GNULIB_POSIXCHECK
1321# undef gethostname
1322# if HAVE_RAW_DECL_GETHOSTNAME 1318# if HAVE_RAW_DECL_GETHOSTNAME
1323_GL_WARN_ON_USE (gethostname, "gethostname is unportable - " 1319_GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
1324 "use gnulib module gethostname for portability"); 1320 "use gnulib module gethostname for portability");
@@ -1337,13 +1333,22 @@ _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
1337 ${LOGNAME-$USER} on Unix platforms, 1333 ${LOGNAME-$USER} on Unix platforms,
1338 $USERNAME on native Windows platforms. 1334 $USERNAME on native Windows platforms.
1339 */ 1335 */
1340# if !@HAVE_DECL_GETLOGIN@ 1336# if @REPLACE_GETLOGIN@
1341_GL_FUNCDECL_SYS (getlogin, char *, (void)); 1337# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1342# endif 1338# define getlogin rpl_getlogin
1339# endif
1340_GL_FUNCDECL_RPL (getlogin, char *, (void), );
1341_GL_CXXALIAS_RPL (getlogin, char *, (void));
1342# else
1343# if !@HAVE_DECL_GETLOGIN@
1344_GL_FUNCDECL_SYS (getlogin, char *, (void), );
1345# endif
1343_GL_CXXALIAS_SYS (getlogin, char *, (void)); 1346_GL_CXXALIAS_SYS (getlogin, char *, (void));
1347# endif
1348# if __GLIBC__ >= 2
1344_GL_CXXALIASWARN (getlogin); 1349_GL_CXXALIASWARN (getlogin);
1350# endif
1345#elif defined GNULIB_POSIXCHECK 1351#elif defined GNULIB_POSIXCHECK
1346# undef getlogin
1347# if HAVE_RAW_DECL_GETLOGIN 1352# if HAVE_RAW_DECL_GETLOGIN
1348_GL_WARN_ON_USE (getlogin, "getlogin is unportable - " 1353_GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
1349 "use gnulib module getlogin for portability"); 1354 "use gnulib module getlogin for portability");
@@ -1370,12 +1375,12 @@ _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
1370# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1375# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1371# define getlogin_r rpl_getlogin_r 1376# define getlogin_r rpl_getlogin_r
1372# endif 1377# endif
1373_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size) 1378_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size),
1374 _GL_ARG_NONNULL ((1))); 1379 _GL_ARG_NONNULL ((1)));
1375_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size)); 1380_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
1376# else 1381# else
1377# if !@HAVE_DECL_GETLOGIN_R@ 1382# if !@HAVE_DECL_GETLOGIN_R@
1378_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size) 1383_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size),
1379 _GL_ARG_NONNULL ((1))); 1384 _GL_ARG_NONNULL ((1)));
1380# endif 1385# endif
1381/* Need to cast, because on Solaris 10 systems, the second argument is 1386/* Need to cast, because on Solaris 10 systems, the second argument is
@@ -1386,7 +1391,6 @@ _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
1386_GL_CXXALIASWARN (getlogin_r); 1391_GL_CXXALIASWARN (getlogin_r);
1387# endif 1392# endif
1388#elif defined GNULIB_POSIXCHECK 1393#elif defined GNULIB_POSIXCHECK
1389# undef getlogin_r
1390# if HAVE_RAW_DECL_GETLOGIN_R 1394# if HAVE_RAW_DECL_GETLOGIN_R
1391_GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - " 1395_GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
1392 "use gnulib module getlogin_r for portability"); 1396 "use gnulib module getlogin_r for portability");
@@ -1399,13 +1403,13 @@ _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
1399# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1403# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1400# define getpagesize rpl_getpagesize 1404# define getpagesize rpl_getpagesize
1401# endif 1405# endif
1402_GL_FUNCDECL_RPL (getpagesize, int, (void)); 1406_GL_FUNCDECL_RPL (getpagesize, int, (void), );
1403_GL_CXXALIAS_RPL (getpagesize, int, (void)); 1407_GL_CXXALIAS_RPL (getpagesize, int, (void));
1404# else 1408# else
1405/* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if 1409/* 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. */ 1410 the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */
1407# if defined __hpux 1411# if defined __hpux
1408_GL_FUNCDECL_SYS (getpagesize, int, (void)); 1412_GL_FUNCDECL_SYS (getpagesize, int, (void), );
1409# endif 1413# endif
1410# if !@HAVE_GETPAGESIZE@ 1414# if !@HAVE_GETPAGESIZE@
1411# if !defined getpagesize 1415# if !defined getpagesize
@@ -1456,7 +1460,7 @@ _GL_FUNCDECL_SYS (getpagesize, int, (void));
1456# define getpagesize() _gl_getpagesize () 1460# define getpagesize() _gl_getpagesize ()
1457# else 1461# else
1458# if !GNULIB_defined_getpagesize_function 1462# if !GNULIB_defined_getpagesize_function
1459_GL_UNISTD_INLINE int 1463_GL_GETPAGESIZE_INLINE int
1460getpagesize () 1464getpagesize ()
1461{ 1465{
1462 return _gl_getpagesize (); 1466 return _gl_getpagesize ();
@@ -1473,7 +1477,6 @@ _GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
1473_GL_CXXALIASWARN (getpagesize); 1477_GL_CXXALIASWARN (getpagesize);
1474# endif 1478# endif
1475#elif defined GNULIB_POSIXCHECK 1479#elif defined GNULIB_POSIXCHECK
1476# undef getpagesize
1477# if HAVE_RAW_DECL_GETPAGESIZE 1480# if HAVE_RAW_DECL_GETPAGESIZE
1478_GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - " 1481_GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
1479 "use gnulib module getpagesize for portability"); 1482 "use gnulib module getpagesize for portability");
@@ -1492,19 +1495,18 @@ _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
1492# undef getpass 1495# undef getpass
1493# define getpass rpl_getpass 1496# define getpass rpl_getpass
1494# endif 1497# endif
1495_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt) 1498_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt),
1496 _GL_ARG_NONNULL ((1))); 1499 _GL_ARG_NONNULL ((1)));
1497_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt)); 1500_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
1498# else 1501# else
1499# if !@HAVE_GETPASS@ 1502# if !@HAVE_GETPASS@
1500_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt) 1503_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt),
1501 _GL_ARG_NONNULL ((1))); 1504 _GL_ARG_NONNULL ((1)));
1502# endif 1505# endif
1503_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt)); 1506_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
1504# endif 1507# endif
1505_GL_CXXALIASWARN (getpass); 1508_GL_CXXALIASWARN (getpass);
1506#elif defined GNULIB_POSIXCHECK 1509#elif defined GNULIB_POSIXCHECK
1507# undef getpass
1508# if HAVE_RAW_DECL_GETPASS 1510# if HAVE_RAW_DECL_GETPASS
1509_GL_WARN_ON_USE (getpass, "getpass is unportable - " 1511_GL_WARN_ON_USE (getpass, "getpass is unportable - "
1510 "use gnulib module getpass or getpass-gnu for portability"); 1512 "use gnulib module getpass or getpass-gnu for portability");
@@ -1530,15 +1532,23 @@ _GL_CXXALIASWARN (getpid);
1530 1532
1531 1533
1532#if @GNULIB_GETUSERSHELL@ 1534#if @GNULIB_GETUSERSHELL@
1535# if @REPLACE_GETUSERSHELL@
1533/* Return the next valid login shell on the system, or NULL when the end of 1536/* Return the next valid login shell on the system, or NULL when the end of
1534 the list has been reached. */ 1537 the list has been reached. */
1535# if !@HAVE_DECL_GETUSERSHELL@ 1538# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1536_GL_FUNCDECL_SYS (getusershell, char *, (void)); 1539# undef getusershell
1537# endif 1540# define getusershell rpl_getusershell
1541# endif
1542_GL_FUNCDECL_RPL (getusershell, char *, (void), );
1543_GL_CXXALIAS_RPL (getusershell, char *, (void));
1544# else
1545# if !@HAVE_DECL_GETUSERSHELL@
1546_GL_FUNCDECL_SYS (getusershell, char *, (void), );
1547# endif
1538_GL_CXXALIAS_SYS (getusershell, char *, (void)); 1548_GL_CXXALIAS_SYS (getusershell, char *, (void));
1549# endif
1539_GL_CXXALIASWARN (getusershell); 1550_GL_CXXALIASWARN (getusershell);
1540#elif defined GNULIB_POSIXCHECK 1551#elif defined GNULIB_POSIXCHECK
1541# undef getusershell
1542# if HAVE_RAW_DECL_GETUSERSHELL 1552# if HAVE_RAW_DECL_GETUSERSHELL
1543_GL_WARN_ON_USE (getusershell, "getusershell is unportable - " 1553_GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
1544 "use gnulib module getusershell for portability"); 1554 "use gnulib module getusershell for portability");
@@ -1547,13 +1557,21 @@ _GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
1547 1557
1548#if @GNULIB_GETUSERSHELL@ 1558#if @GNULIB_GETUSERSHELL@
1549/* Rewind to pointer that is advanced at each getusershell() call. */ 1559/* Rewind to pointer that is advanced at each getusershell() call. */
1550# if !@HAVE_DECL_GETUSERSHELL@ 1560# if @REPLACE_GETUSERSHELL@
1551_GL_FUNCDECL_SYS (setusershell, void, (void)); 1561# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1552# endif 1562# undef setusershell
1563# define setusershell rpl_setusershell
1564# endif
1565_GL_FUNCDECL_RPL (setusershell, void, (void), );
1566_GL_CXXALIAS_RPL (setusershell, void, (void));
1567# else
1568# if !@HAVE_DECL_GETUSERSHELL@
1569_GL_FUNCDECL_SYS (setusershell, void, (void), );
1570# endif
1553_GL_CXXALIAS_SYS (setusershell, void, (void)); 1571_GL_CXXALIAS_SYS (setusershell, void, (void));
1572# endif
1554_GL_CXXALIASWARN (setusershell); 1573_GL_CXXALIASWARN (setusershell);
1555#elif defined GNULIB_POSIXCHECK 1574#elif defined GNULIB_POSIXCHECK
1556# undef setusershell
1557# if HAVE_RAW_DECL_SETUSERSHELL 1575# if HAVE_RAW_DECL_SETUSERSHELL
1558_GL_WARN_ON_USE (setusershell, "setusershell is unportable - " 1576_GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
1559 "use gnulib module getusershell for portability"); 1577 "use gnulib module getusershell for portability");
@@ -1563,13 +1581,21 @@ _GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
1563#if @GNULIB_GETUSERSHELL@ 1581#if @GNULIB_GETUSERSHELL@
1564/* Free the pointer that is advanced at each getusershell() call and 1582/* Free the pointer that is advanced at each getusershell() call and
1565 associated resources. */ 1583 associated resources. */
1566# if !@HAVE_DECL_GETUSERSHELL@ 1584# if @REPLACE_GETUSERSHELL@
1567_GL_FUNCDECL_SYS (endusershell, void, (void)); 1585# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1568# endif 1586# undef endusershell
1587# define endusershell rpl_endusershell
1588# endif
1589_GL_FUNCDECL_RPL (endusershell, void, (void), );
1590_GL_CXXALIAS_RPL (endusershell, void, (void));
1591# else
1592# if !@HAVE_DECL_GETUSERSHELL@
1593_GL_FUNCDECL_SYS (endusershell, void, (void), );
1594# endif
1569_GL_CXXALIAS_SYS (endusershell, void, (void)); 1595_GL_CXXALIAS_SYS (endusershell, void, (void));
1596# endif
1570_GL_CXXALIASWARN (endusershell); 1597_GL_CXXALIASWARN (endusershell);
1571#elif defined GNULIB_POSIXCHECK 1598#elif defined GNULIB_POSIXCHECK
1572# undef endusershell
1573# if HAVE_RAW_DECL_ENDUSERSHELL 1599# if HAVE_RAW_DECL_ENDUSERSHELL
1574_GL_WARN_ON_USE (endusershell, "endusershell is unportable - " 1600_GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
1575 "use gnulib module getusershell for portability"); 1601 "use gnulib module getusershell for portability");
@@ -1580,12 +1606,11 @@ _GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
1580#if @GNULIB_GROUP_MEMBER@ 1606#if @GNULIB_GROUP_MEMBER@
1581/* Determine whether group id is in calling user's group list. */ 1607/* Determine whether group id is in calling user's group list. */
1582# if !@HAVE_GROUP_MEMBER@ 1608# if !@HAVE_GROUP_MEMBER@
1583_GL_FUNCDECL_SYS (group_member, int, (gid_t gid)); 1609_GL_FUNCDECL_SYS (group_member, int, (gid_t gid), );
1584# endif 1610# endif
1585_GL_CXXALIAS_SYS (group_member, int, (gid_t gid)); 1611_GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
1586_GL_CXXALIASWARN (group_member); 1612_GL_CXXALIASWARN (group_member);
1587#elif defined GNULIB_POSIXCHECK 1613#elif defined GNULIB_POSIXCHECK
1588# undef group_member
1589# if HAVE_RAW_DECL_GROUP_MEMBER 1614# if HAVE_RAW_DECL_GROUP_MEMBER
1590_GL_WARN_ON_USE (group_member, "group_member is unportable - " 1615_GL_WARN_ON_USE (group_member, "group_member is unportable - "
1591 "use gnulib module group-member for portability"); 1616 "use gnulib module group-member for portability");
@@ -1600,7 +1625,7 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - "
1600# define isatty rpl_isatty 1625# define isatty rpl_isatty
1601# endif 1626# endif
1602# define GNULIB_defined_isatty 1 1627# define GNULIB_defined_isatty 1
1603_GL_FUNCDECL_RPL (isatty, int, (int fd)); 1628_GL_FUNCDECL_RPL (isatty, int, (int fd), );
1604_GL_CXXALIAS_RPL (isatty, int, (int fd)); 1629_GL_CXXALIAS_RPL (isatty, int, (int fd));
1605# elif defined _WIN32 && !defined __CYGWIN__ 1630# elif defined _WIN32 && !defined __CYGWIN__
1606# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1631# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1613,7 +1638,6 @@ _GL_CXXALIAS_SYS (isatty, int, (int fd));
1613# endif 1638# endif
1614_GL_CXXALIASWARN (isatty); 1639_GL_CXXALIASWARN (isatty);
1615#elif defined GNULIB_POSIXCHECK 1640#elif defined GNULIB_POSIXCHECK
1616# undef isatty
1617# if HAVE_RAW_DECL_ISATTY 1641# if HAVE_RAW_DECL_ISATTY
1618_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " 1642_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
1619 "use gnulib module isatty for portability"); 1643 "use gnulib module isatty for portability");
@@ -1646,19 +1670,18 @@ _GL_CXXALIASWARN (isatty);
1646# undef lchown 1670# undef lchown
1647# define lchown rpl_lchown 1671# define lchown rpl_lchown
1648# endif 1672# endif
1649_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group) 1673_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group),
1650 _GL_ARG_NONNULL ((1))); 1674 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1651_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)); 1675_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
1652# else 1676# else
1653# if !@HAVE_LCHOWN@ 1677# if !@HAVE_LCHOWN@
1654_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group) 1678_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group),
1655 _GL_ARG_NONNULL ((1))); 1679 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1656# endif 1680# endif
1657_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)); 1681_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
1658# endif 1682# endif
1659_GL_CXXALIASWARN (lchown); 1683_GL_CXXALIASWARN (lchown);
1660#elif defined GNULIB_POSIXCHECK 1684#elif defined GNULIB_POSIXCHECK
1661# undef lchown
1662# if HAVE_RAW_DECL_LCHOWN 1685# if HAVE_RAW_DECL_LCHOWN
1663_GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - " 1686_GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
1664 "use gnulib module lchown for portability"); 1687 "use gnulib module lchown for portability");
@@ -1675,19 +1698,18 @@ _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
1675# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1698# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1676# define link rpl_link 1699# define link rpl_link
1677# endif 1700# endif
1678_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2) 1701_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2),
1679 _GL_ARG_NONNULL ((1, 2))); 1702 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
1680_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2)); 1703_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
1681# else 1704# else
1682# if !@HAVE_LINK@ 1705# if !@HAVE_LINK@
1683_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2) 1706_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2),
1684 _GL_ARG_NONNULL ((1, 2))); 1707 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
1685# endif 1708# endif
1686_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2)); 1709_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
1687# endif 1710# endif
1688_GL_CXXALIASWARN (link); 1711_GL_CXXALIASWARN (link);
1689#elif defined GNULIB_POSIXCHECK 1712#elif defined GNULIB_POSIXCHECK
1690# undef link
1691# if HAVE_RAW_DECL_LINK 1713# if HAVE_RAW_DECL_LINK
1692_GL_WARN_ON_USE (link, "link is unportable - " 1714_GL_WARN_ON_USE (link, "link is unportable - "
1693 "use gnulib module link for portability"); 1715 "use gnulib module link for portability");
@@ -1706,8 +1728,8 @@ _GL_WARN_ON_USE (link, "link is unportable - "
1706# endif 1728# endif
1707_GL_FUNCDECL_RPL (linkat, int, 1729_GL_FUNCDECL_RPL (linkat, int,
1708 (int fd1, const char *path1, int fd2, const char *path2, 1730 (int fd1, const char *path1, int fd2, const char *path2,
1709 int flag) 1731 int flag),
1710 _GL_ARG_NONNULL ((2, 4))); 1732 _GL_ARG_NONNULL ((2, 4)) _GL_ATTRIBUTE_NODISCARD);
1711_GL_CXXALIAS_RPL (linkat, int, 1733_GL_CXXALIAS_RPL (linkat, int,
1712 (int fd1, const char *path1, int fd2, const char *path2, 1734 (int fd1, const char *path1, int fd2, const char *path2,
1713 int flag)); 1735 int flag));
@@ -1715,8 +1737,8 @@ _GL_CXXALIAS_RPL (linkat, int,
1715# if !@HAVE_LINKAT@ 1737# if !@HAVE_LINKAT@
1716_GL_FUNCDECL_SYS (linkat, int, 1738_GL_FUNCDECL_SYS (linkat, int,
1717 (int fd1, const char *path1, int fd2, const char *path2, 1739 (int fd1, const char *path1, int fd2, const char *path2,
1718 int flag) 1740 int flag),
1719 _GL_ARG_NONNULL ((2, 4))); 1741 _GL_ARG_NONNULL ((2, 4)) _GL_ATTRIBUTE_NODISCARD);
1720# endif 1742# endif
1721_GL_CXXALIAS_SYS (linkat, int, 1743_GL_CXXALIAS_SYS (linkat, int,
1722 (int fd1, const char *path1, int fd2, const char *path2, 1744 (int fd1, const char *path1, int fd2, const char *path2,
@@ -1726,7 +1748,6 @@ _GL_CXXALIAS_SYS (linkat, int,
1726_GL_CXXALIASWARN (linkat); 1748_GL_CXXALIASWARN (linkat);
1727# endif 1749# endif
1728#elif defined GNULIB_POSIXCHECK 1750#elif defined GNULIB_POSIXCHECK
1729# undef linkat
1730# if HAVE_RAW_DECL_LINKAT 1751# if HAVE_RAW_DECL_LINKAT
1731_GL_WARN_ON_USE (linkat, "linkat is unportable - " 1752_GL_WARN_ON_USE (linkat, "linkat is unportable - "
1732 "use gnulib module linkat for portability"); 1753 "use gnulib module linkat for portability");
@@ -1743,7 +1764,7 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - "
1743# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1764# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1744# define lseek rpl_lseek 1765# define lseek rpl_lseek
1745# endif 1766# endif
1746_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence)); 1767_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)); 1768_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
1748# elif defined _WIN32 && !defined __CYGWIN__ 1769# elif defined _WIN32 && !defined __CYGWIN__
1749# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1770# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1756,7 +1777,6 @@ _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
1756# endif 1777# endif
1757_GL_CXXALIASWARN (lseek); 1778_GL_CXXALIASWARN (lseek);
1758#elif defined GNULIB_POSIXCHECK 1779#elif defined GNULIB_POSIXCHECK
1759# undef lseek
1760# if HAVE_RAW_DECL_LSEEK 1780# if HAVE_RAW_DECL_LSEEK
1761_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some " 1781_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
1762 "systems - use gnulib module lseek for portability"); 1782 "systems - use gnulib module lseek for portability");
@@ -1783,12 +1803,12 @@ _GL_CXXALIASWARN (lseek);
1783 Store the read-end as fd[0] and the write-end as fd[1]. 1803 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. */ 1804 Return 0 upon success, or -1 with errno set upon failure. */
1785# if !@HAVE_PIPE@ 1805# if !@HAVE_PIPE@
1786_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1))); 1806_GL_FUNCDECL_SYS (pipe, int, (int fd[2]),
1807 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1787# endif 1808# endif
1788_GL_CXXALIAS_SYS (pipe, int, (int fd[2])); 1809_GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
1789_GL_CXXALIASWARN (pipe); 1810_GL_CXXALIASWARN (pipe);
1790#elif defined GNULIB_POSIXCHECK 1811#elif defined GNULIB_POSIXCHECK
1791# undef pipe
1792# if HAVE_RAW_DECL_PIPE 1812# if HAVE_RAW_DECL_PIPE
1793_GL_WARN_ON_USE (pipe, "pipe is unportable - " 1813_GL_WARN_ON_USE (pipe, "pipe is unportable - "
1794 "use gnulib module pipe-posix for portability"); 1814 "use gnulib module pipe-posix for portability");
@@ -1810,17 +1830,18 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - "
1810# undef pipe2 1830# undef pipe2
1811# define pipe2 rpl_pipe2 1831# define pipe2 rpl_pipe2
1812# endif 1832# endif
1813_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); 1833_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags),
1834 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1814_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags)); 1835_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
1815# else 1836# else
1816_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); 1837_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags),
1838 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
1817_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags)); 1839_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
1818# endif 1840# endif
1819# if __GLIBC__ >= 2 1841# if __GLIBC__ >= 2
1820_GL_CXXALIASWARN (pipe2); 1842_GL_CXXALIASWARN (pipe2);
1821# endif 1843# endif
1822#elif defined GNULIB_POSIXCHECK 1844#elif defined GNULIB_POSIXCHECK
1823# undef pipe2
1824# if HAVE_RAW_DECL_PIPE2 1845# if HAVE_RAW_DECL_PIPE2
1825_GL_WARN_ON_USE (pipe2, "pipe2 is unportable - " 1846_GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
1826 "use gnulib module pipe2 for portability"); 1847 "use gnulib module pipe2 for portability");
@@ -1840,15 +1861,15 @@ _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
1840# define pread rpl_pread 1861# define pread rpl_pread
1841# endif 1862# endif
1842_GL_FUNCDECL_RPL (pread, ssize_t, 1863_GL_FUNCDECL_RPL (pread, ssize_t,
1843 (int fd, void *buf, size_t bufsize, off_t offset) 1864 (int fd, void *buf, size_t bufsize, off_t offset),
1844 _GL_ARG_NONNULL ((2))); 1865 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
1845_GL_CXXALIAS_RPL (pread, ssize_t, 1866_GL_CXXALIAS_RPL (pread, ssize_t,
1846 (int fd, void *buf, size_t bufsize, off_t offset)); 1867 (int fd, void *buf, size_t bufsize, off_t offset));
1847# else 1868# else
1848# if !@HAVE_PREAD@ 1869# if !@HAVE_PREAD@
1849_GL_FUNCDECL_SYS (pread, ssize_t, 1870_GL_FUNCDECL_SYS (pread, ssize_t,
1850 (int fd, void *buf, size_t bufsize, off_t offset) 1871 (int fd, void *buf, size_t bufsize, off_t offset),
1851 _GL_ARG_NONNULL ((2))); 1872 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
1852# endif 1873# endif
1853_GL_CXXALIAS_SYS (pread, ssize_t, 1874_GL_CXXALIAS_SYS (pread, ssize_t,
1854 (int fd, void *buf, size_t bufsize, off_t offset)); 1875 (int fd, void *buf, size_t bufsize, off_t offset));
@@ -1857,7 +1878,6 @@ _GL_CXXALIAS_SYS (pread, ssize_t,
1857_GL_CXXALIASWARN (pread); 1878_GL_CXXALIASWARN (pread);
1858# endif 1879# endif
1859#elif defined GNULIB_POSIXCHECK 1880#elif defined GNULIB_POSIXCHECK
1860# undef pread
1861# if HAVE_RAW_DECL_PREAD 1881# if HAVE_RAW_DECL_PREAD
1862_GL_WARN_ON_USE (pread, "pread is unportable - " 1882_GL_WARN_ON_USE (pread, "pread is unportable - "
1863 "use gnulib module pread for portability"); 1883 "use gnulib module pread for portability");
@@ -1877,15 +1897,15 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
1877# define pwrite rpl_pwrite 1897# define pwrite rpl_pwrite
1878# endif 1898# endif
1879_GL_FUNCDECL_RPL (pwrite, ssize_t, 1899_GL_FUNCDECL_RPL (pwrite, ssize_t,
1880 (int fd, const void *buf, size_t bufsize, off_t offset) 1900 (int fd, const void *buf, size_t bufsize, off_t offset),
1881 _GL_ARG_NONNULL ((2))); 1901 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
1882_GL_CXXALIAS_RPL (pwrite, ssize_t, 1902_GL_CXXALIAS_RPL (pwrite, ssize_t,
1883 (int fd, const void *buf, size_t bufsize, off_t offset)); 1903 (int fd, const void *buf, size_t bufsize, off_t offset));
1884# else 1904# else
1885# if !@HAVE_PWRITE@ 1905# if !@HAVE_PWRITE@
1886_GL_FUNCDECL_SYS (pwrite, ssize_t, 1906_GL_FUNCDECL_SYS (pwrite, ssize_t,
1887 (int fd, const void *buf, size_t bufsize, off_t offset) 1907 (int fd, const void *buf, size_t bufsize, off_t offset),
1888 _GL_ARG_NONNULL ((2))); 1908 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
1889# endif 1909# endif
1890_GL_CXXALIAS_SYS (pwrite, ssize_t, 1910_GL_CXXALIAS_SYS (pwrite, ssize_t,
1891 (int fd, const void *buf, size_t bufsize, off_t offset)); 1911 (int fd, const void *buf, size_t bufsize, off_t offset));
@@ -1894,7 +1914,6 @@ _GL_CXXALIAS_SYS (pwrite, ssize_t,
1894_GL_CXXALIASWARN (pwrite); 1914_GL_CXXALIASWARN (pwrite);
1895# endif 1915# endif
1896#elif defined GNULIB_POSIXCHECK 1916#elif defined GNULIB_POSIXCHECK
1897# undef pwrite
1898# if HAVE_RAW_DECL_PWRITE 1917# if HAVE_RAW_DECL_PWRITE
1899_GL_WARN_ON_USE (pwrite, "pwrite is unportable - " 1918_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
1900 "use gnulib module pwrite for portability"); 1919 "use gnulib module pwrite for portability");
@@ -1911,8 +1930,9 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
1911# undef read 1930# undef read
1912# define read rpl_read 1931# define read rpl_read
1913# endif 1932# endif
1914_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count) 1933
1915 _GL_ARG_NONNULL ((2))); 1934_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count),
1935 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
1916_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); 1936_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
1917# elif defined _WIN32 && !defined __CYGWIN__ 1937# elif defined _WIN32 && !defined __CYGWIN__
1918# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1938# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1933,11 +1953,7 @@ _GL_CXXALIASWARN (read);
1933# undef read 1953# undef read
1934# define read _read 1954# define read _read
1935# endif 1955# endif
1936# ifdef __MINGW32__ 1956_GL_CXXALIAS_MDA_CAST (read, ssize_t, (int fd, void *buf, unsigned int count));
1937_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count));
1938# else
1939_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count));
1940# endif
1941# else 1957# else
1942_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count)); 1958_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
1943# endif 1959# endif
@@ -1957,8 +1973,8 @@ _GL_CXXALIASWARN (read);
1957# endif 1973# endif
1958_GL_FUNCDECL_RPL (readlink, ssize_t, 1974_GL_FUNCDECL_RPL (readlink, ssize_t,
1959 (const char *restrict file, 1975 (const char *restrict file,
1960 char *restrict buf, size_t bufsize) 1976 char *restrict buf, size_t bufsize),
1961 _GL_ARG_NONNULL ((1, 2))); 1977 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
1962_GL_CXXALIAS_RPL (readlink, ssize_t, 1978_GL_CXXALIAS_RPL (readlink, ssize_t,
1963 (const char *restrict file, 1979 (const char *restrict file,
1964 char *restrict buf, size_t bufsize)); 1980 char *restrict buf, size_t bufsize));
@@ -1966,8 +1982,8 @@ _GL_CXXALIAS_RPL (readlink, ssize_t,
1966# if !@HAVE_READLINK@ 1982# if !@HAVE_READLINK@
1967_GL_FUNCDECL_SYS (readlink, ssize_t, 1983_GL_FUNCDECL_SYS (readlink, ssize_t,
1968 (const char *restrict file, 1984 (const char *restrict file,
1969 char *restrict buf, size_t bufsize) 1985 char *restrict buf, size_t bufsize),
1970 _GL_ARG_NONNULL ((1, 2))); 1986 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
1971# endif 1987# endif
1972_GL_CXXALIAS_SYS (readlink, ssize_t, 1988_GL_CXXALIAS_SYS (readlink, ssize_t,
1973 (const char *restrict file, 1989 (const char *restrict file,
@@ -1975,7 +1991,6 @@ _GL_CXXALIAS_SYS (readlink, ssize_t,
1975# endif 1991# endif
1976_GL_CXXALIASWARN (readlink); 1992_GL_CXXALIASWARN (readlink);
1977#elif defined GNULIB_POSIXCHECK 1993#elif defined GNULIB_POSIXCHECK
1978# undef readlink
1979# if HAVE_RAW_DECL_READLINK 1994# if HAVE_RAW_DECL_READLINK
1980_GL_WARN_ON_USE (readlink, "readlink is unportable - " 1995_GL_WARN_ON_USE (readlink, "readlink is unportable - "
1981 "use gnulib module readlink for portability"); 1996 "use gnulib module readlink for portability");
@@ -1990,8 +2005,8 @@ _GL_WARN_ON_USE (readlink, "readlink is unportable - "
1990# endif 2005# endif
1991_GL_FUNCDECL_RPL (readlinkat, ssize_t, 2006_GL_FUNCDECL_RPL (readlinkat, ssize_t,
1992 (int fd, char const *restrict file, 2007 (int fd, char const *restrict file,
1993 char *restrict buf, size_t len) 2008 char *restrict buf, size_t len),
1994 _GL_ARG_NONNULL ((2, 3))); 2009 _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
1995_GL_CXXALIAS_RPL (readlinkat, ssize_t, 2010_GL_CXXALIAS_RPL (readlinkat, ssize_t,
1996 (int fd, char const *restrict file, 2011 (int fd, char const *restrict file,
1997 char *restrict buf, size_t len)); 2012 char *restrict buf, size_t len));
@@ -1999,8 +2014,8 @@ _GL_CXXALIAS_RPL (readlinkat, ssize_t,
1999# if !@HAVE_READLINKAT@ 2014# if !@HAVE_READLINKAT@
2000_GL_FUNCDECL_SYS (readlinkat, ssize_t, 2015_GL_FUNCDECL_SYS (readlinkat, ssize_t,
2001 (int fd, char const *restrict file, 2016 (int fd, char const *restrict file,
2002 char *restrict buf, size_t len) 2017 char *restrict buf, size_t len),
2003 _GL_ARG_NONNULL ((2, 3))); 2018 _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD);
2004# endif 2019# endif
2005_GL_CXXALIAS_SYS (readlinkat, ssize_t, 2020_GL_CXXALIAS_SYS (readlinkat, ssize_t,
2006 (int fd, char const *restrict file, 2021 (int fd, char const *restrict file,
@@ -2010,7 +2025,6 @@ _GL_CXXALIAS_SYS (readlinkat, ssize_t,
2010_GL_CXXALIASWARN (readlinkat); 2025_GL_CXXALIASWARN (readlinkat);
2011# endif 2026# endif
2012#elif defined GNULIB_POSIXCHECK 2027#elif defined GNULIB_POSIXCHECK
2013# undef readlinkat
2014# if HAVE_RAW_DECL_READLINKAT 2028# if HAVE_RAW_DECL_READLINKAT
2015_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - " 2029_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
2016 "use gnulib module readlinkat for portability"); 2030 "use gnulib module readlinkat for portability");
@@ -2024,7 +2038,7 @@ _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
2024# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 2038# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2025# define rmdir rpl_rmdir 2039# define rmdir rpl_rmdir
2026# endif 2040# endif
2027_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1))); 2041_GL_FUNCDECL_RPL (rmdir, int, (char const *name), _GL_ARG_NONNULL ((1)));
2028_GL_CXXALIAS_RPL (rmdir, int, (char const *name)); 2042_GL_CXXALIAS_RPL (rmdir, int, (char const *name));
2029# elif defined _WIN32 && !defined __CYGWIN__ 2043# elif defined _WIN32 && !defined __CYGWIN__
2030# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 2044# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -2037,7 +2051,6 @@ _GL_CXXALIAS_SYS (rmdir, int, (char const *name));
2037# endif 2051# endif
2038_GL_CXXALIASWARN (rmdir); 2052_GL_CXXALIASWARN (rmdir);
2039#elif defined GNULIB_POSIXCHECK 2053#elif defined GNULIB_POSIXCHECK
2040# undef rmdir
2041# if HAVE_RAW_DECL_RMDIR 2054# if HAVE_RAW_DECL_RMDIR
2042_GL_WARN_ON_USE (rmdir, "rmdir is unportable - " 2055_GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
2043 "use gnulib module rmdir for portability"); 2056 "use gnulib module rmdir for portability");
@@ -2073,24 +2086,27 @@ _GL_CXXALIASWARN (rmdir);
2073# undef sethostname 2086# undef sethostname
2074# define sethostname rpl_sethostname 2087# define sethostname rpl_sethostname
2075# endif 2088# endif
2076_GL_FUNCDECL_RPL (sethostname, int, (const char *name, size_t len) 2089_GL_FUNCDECL_RPL (sethostname, int,
2077 _GL_ARG_NONNULL ((1))); 2090 (const char *name, size_t len),
2078_GL_CXXALIAS_RPL (sethostname, int, (const char *name, size_t len)); 2091 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
2092_GL_CXXALIAS_RPL (sethostname, int,
2093 (const char *name, size_t len));
2079# else 2094# else
2080# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@ 2095# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
2081_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) 2096_GL_FUNCDECL_SYS (sethostname, int,
2082 _GL_ARG_NONNULL ((1))); 2097 (const char *name, size_t len),
2098 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
2083# endif 2099# endif
2084/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 2100/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, and FreeBSD 6.4
2085 and FreeBSD 6.4 the second parameter is int. On Solaris 11 2101 the second parameter is int. On Solaris 11 2011-10, the first parameter is
2086 2011-10, the first parameter is not const. */ 2102 not const. */
2087_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); 2103_GL_CXXALIAS_SYS_CAST (sethostname, int,
2104 (const char *name, size_t len));
2088# endif 2105# endif
2089# if __GLIBC__ >= 2 2106# if __GLIBC__ >= 2
2090_GL_CXXALIASWARN (sethostname); 2107_GL_CXXALIASWARN (sethostname);
2091# endif 2108# endif
2092#elif defined GNULIB_POSIXCHECK 2109#elif defined GNULIB_POSIXCHECK
2093# undef sethostname
2094# if HAVE_RAW_DECL_SETHOSTNAME 2110# if HAVE_RAW_DECL_SETHOSTNAME
2095_GL_WARN_ON_USE (sethostname, "sethostname is unportable - " 2111_GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
2096 "use gnulib module sethostname for portability"); 2112 "use gnulib module sethostname for portability");
@@ -2108,17 +2124,16 @@ _GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
2108# undef sleep 2124# undef sleep
2109# define sleep rpl_sleep 2125# define sleep rpl_sleep
2110# endif 2126# endif
2111_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n)); 2127_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n), );
2112_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n)); 2128_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
2113# else 2129# else
2114# if !@HAVE_SLEEP@ 2130# if !@HAVE_SLEEP@
2115_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n)); 2131_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n), );
2116# endif 2132# endif
2117_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n)); 2133_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
2118# endif 2134# endif
2119_GL_CXXALIASWARN (sleep); 2135_GL_CXXALIASWARN (sleep);
2120#elif defined GNULIB_POSIXCHECK 2136#elif defined GNULIB_POSIXCHECK
2121# undef sleep
2122# if HAVE_RAW_DECL_SLEEP 2137# if HAVE_RAW_DECL_SLEEP
2123_GL_WARN_ON_USE (sleep, "sleep is unportable - " 2138_GL_WARN_ON_USE (sleep, "sleep is unportable - "
2124 "use gnulib module sleep for portability"); 2139 "use gnulib module sleep for portability");
@@ -2157,19 +2172,22 @@ _GL_CXXALIASWARN (swab);
2157# undef symlink 2172# undef symlink
2158# define symlink rpl_symlink 2173# define symlink rpl_symlink
2159# endif 2174# endif
2160_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file) 2175_GL_FUNCDECL_RPL (symlink, int,
2161 _GL_ARG_NONNULL ((1, 2))); 2176 (char const *contents, char const *file),
2162_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file)); 2177 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
2178_GL_CXXALIAS_RPL (symlink, int,
2179 (char const *contents, char const *file));
2163# else 2180# else
2164# if !@HAVE_SYMLINK@ 2181# if !@HAVE_SYMLINK@
2165_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file) 2182_GL_FUNCDECL_SYS (symlink, int,
2166 _GL_ARG_NONNULL ((1, 2))); 2183 (char const *contents, char const *file),
2184 _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD);
2167# endif 2185# endif
2168_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file)); 2186_GL_CXXALIAS_SYS (symlink, int,
2187 (char const *contents, char const *file));
2169# endif 2188# endif
2170_GL_CXXALIASWARN (symlink); 2189_GL_CXXALIASWARN (symlink);
2171#elif defined GNULIB_POSIXCHECK 2190#elif defined GNULIB_POSIXCHECK
2172# undef symlink
2173# if HAVE_RAW_DECL_SYMLINK 2191# if HAVE_RAW_DECL_SYMLINK
2174_GL_WARN_ON_USE (symlink, "symlink is not portable - " 2192_GL_WARN_ON_USE (symlink, "symlink is not portable - "
2175 "use gnulib module symlink for portability"); 2193 "use gnulib module symlink for portability");
@@ -2184,15 +2202,15 @@ _GL_WARN_ON_USE (symlink, "symlink is not portable - "
2184# define symlinkat rpl_symlinkat 2202# define symlinkat rpl_symlinkat
2185# endif 2203# endif
2186_GL_FUNCDECL_RPL (symlinkat, int, 2204_GL_FUNCDECL_RPL (symlinkat, int,
2187 (char const *contents, int fd, char const *file) 2205 (char const *contents, int fd, char const *file),
2188 _GL_ARG_NONNULL ((1, 3))); 2206 _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
2189_GL_CXXALIAS_RPL (symlinkat, int, 2207_GL_CXXALIAS_RPL (symlinkat, int,
2190 (char const *contents, int fd, char const *file)); 2208 (char const *contents, int fd, char const *file));
2191# else 2209# else
2192# if !@HAVE_SYMLINKAT@ 2210# if !@HAVE_SYMLINKAT@
2193_GL_FUNCDECL_SYS (symlinkat, int, 2211_GL_FUNCDECL_SYS (symlinkat, int,
2194 (char const *contents, int fd, char const *file) 2212 (char const *contents, int fd, char const *file),
2195 _GL_ARG_NONNULL ((1, 3))); 2213 _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD);
2196# endif 2214# endif
2197_GL_CXXALIAS_SYS (symlinkat, int, 2215_GL_CXXALIAS_SYS (symlinkat, int,
2198 (char const *contents, int fd, char const *file)); 2216 (char const *contents, int fd, char const *file));
@@ -2201,7 +2219,6 @@ _GL_CXXALIAS_SYS (symlinkat, int,
2201_GL_CXXALIASWARN (symlinkat); 2219_GL_CXXALIASWARN (symlinkat);
2202# endif 2220# endif
2203#elif defined GNULIB_POSIXCHECK 2221#elif defined GNULIB_POSIXCHECK
2204# undef symlinkat
2205# if HAVE_RAW_DECL_SYMLINKAT 2222# if HAVE_RAW_DECL_SYMLINKAT
2206_GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - " 2223_GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
2207 "use gnulib module symlinkat for portability"); 2224 "use gnulib module symlinkat for portability");
@@ -2219,13 +2236,13 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
2219# undef truncate 2236# undef truncate
2220# define truncate rpl_truncate 2237# define truncate rpl_truncate
2221# endif 2238# endif
2222_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length) 2239_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length),
2223 _GL_ARG_NONNULL ((1))); 2240 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
2224_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length)); 2241_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
2225# else 2242# else
2226# if !@HAVE_DECL_TRUNCATE@ 2243# if !@HAVE_DECL_TRUNCATE@
2227_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length) 2244_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length),
2228 _GL_ARG_NONNULL ((1))); 2245 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD);
2229# endif 2246# endif
2230_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); 2247_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
2231# endif 2248# endif
@@ -2233,7 +2250,6 @@ _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
2233_GL_CXXALIASWARN (truncate); 2250_GL_CXXALIASWARN (truncate);
2234# endif 2251# endif
2235#elif defined GNULIB_POSIXCHECK 2252#elif defined GNULIB_POSIXCHECK
2236# undef truncate
2237# if HAVE_RAW_DECL_TRUNCATE 2253# if HAVE_RAW_DECL_TRUNCATE
2238_GL_WARN_ON_USE (truncate, "truncate is unportable - " 2254_GL_WARN_ON_USE (truncate, "truncate is unportable - "
2239 "use gnulib module truncate for portability"); 2255 "use gnulib module truncate for portability");
@@ -2250,13 +2266,15 @@ _GL_WARN_ON_USE (truncate, "truncate is unportable - "
2250# define ttyname_r rpl_ttyname_r 2266# define ttyname_r rpl_ttyname_r
2251# endif 2267# endif
2252_GL_FUNCDECL_RPL (ttyname_r, int, 2268_GL_FUNCDECL_RPL (ttyname_r, int,
2253 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); 2269 (int fd, char *buf, size_t buflen),
2270 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
2254_GL_CXXALIAS_RPL (ttyname_r, int, 2271_GL_CXXALIAS_RPL (ttyname_r, int,
2255 (int fd, char *buf, size_t buflen)); 2272 (int fd, char *buf, size_t buflen));
2256# else 2273# else
2257# if !@HAVE_DECL_TTYNAME_R@ 2274# if !@HAVE_DECL_TTYNAME_R@
2258_GL_FUNCDECL_SYS (ttyname_r, int, 2275_GL_FUNCDECL_SYS (ttyname_r, int,
2259 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); 2276 (int fd, char *buf, size_t buflen),
2277 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
2260# endif 2278# endif
2261_GL_CXXALIAS_SYS (ttyname_r, int, 2279_GL_CXXALIAS_SYS (ttyname_r, int,
2262 (int fd, char *buf, size_t buflen)); 2280 (int fd, char *buf, size_t buflen));
@@ -2265,7 +2283,6 @@ _GL_CXXALIAS_SYS (ttyname_r, int,
2265_GL_CXXALIASWARN (ttyname_r); 2283_GL_CXXALIASWARN (ttyname_r);
2266# endif 2284# endif
2267#elif defined GNULIB_POSIXCHECK 2285#elif defined GNULIB_POSIXCHECK
2268# undef ttyname_r
2269# if HAVE_RAW_DECL_TTYNAME_R 2286# if HAVE_RAW_DECL_TTYNAME_R
2270_GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - " 2287_GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
2271 "use gnulib module ttyname_r for portability"); 2288 "use gnulib module ttyname_r for portability");
@@ -2279,7 +2296,7 @@ _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
2279# undef unlink 2296# undef unlink
2280# define unlink rpl_unlink 2297# define unlink rpl_unlink
2281# endif 2298# endif
2282_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1))); 2299_GL_FUNCDECL_RPL (unlink, int, (char const *file), _GL_ARG_NONNULL ((1)));
2283_GL_CXXALIAS_RPL (unlink, int, (char const *file)); 2300_GL_CXXALIAS_RPL (unlink, int, (char const *file));
2284# elif defined _WIN32 && !defined __CYGWIN__ 2301# elif defined _WIN32 && !defined __CYGWIN__
2285# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 2302# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -2292,7 +2309,6 @@ _GL_CXXALIAS_SYS (unlink, int, (char const *file));
2292# endif 2309# endif
2293_GL_CXXALIASWARN (unlink); 2310_GL_CXXALIASWARN (unlink);
2294#elif defined GNULIB_POSIXCHECK 2311#elif defined GNULIB_POSIXCHECK
2295# undef unlink
2296# if HAVE_RAW_DECL_UNLINK 2312# if HAVE_RAW_DECL_UNLINK
2297_GL_WARN_ON_USE (unlink, "unlink is not portable - " 2313_GL_WARN_ON_USE (unlink, "unlink is not portable - "
2298 "use gnulib module unlink for portability"); 2314 "use gnulib module unlink for portability");
@@ -2320,19 +2336,18 @@ _GL_CXXALIASWARN (unlink);
2320# undef unlinkat 2336# undef unlinkat
2321# define unlinkat rpl_unlinkat 2337# define unlinkat rpl_unlinkat
2322# endif 2338# endif
2323_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag) 2339_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag),
2324 _GL_ARG_NONNULL ((2))); 2340 _GL_ARG_NONNULL ((2)));
2325_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag)); 2341_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
2326# else 2342# else
2327# if !@HAVE_UNLINKAT@ 2343# if !@HAVE_UNLINKAT@
2328_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag) 2344_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag),
2329 _GL_ARG_NONNULL ((2))); 2345 _GL_ARG_NONNULL ((2)));
2330# endif 2346# endif
2331_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag)); 2347_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
2332# endif 2348# endif
2333_GL_CXXALIASWARN (unlinkat); 2349_GL_CXXALIASWARN (unlinkat);
2334#elif defined GNULIB_POSIXCHECK 2350#elif defined GNULIB_POSIXCHECK
2335# undef unlinkat
2336# if HAVE_RAW_DECL_UNLINKAT 2351# if HAVE_RAW_DECL_UNLINKAT
2337_GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - " 2352_GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
2338 "use gnulib module unlinkat for portability"); 2353 "use gnulib module unlinkat for portability");
@@ -2343,18 +2358,18 @@ _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
2343#if @GNULIB_USLEEP@ 2358#if @GNULIB_USLEEP@
2344/* Pause the execution of the current thread for N microseconds. 2359/* Pause the execution of the current thread for N microseconds.
2345 Returns 0 on completion, or -1 on range error. 2360 Returns 0 on completion, or -1 on range error.
2346 See the POSIX:2001 specification 2361 See the POSIX.1-2004 specification
2347 <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>. */ 2362 <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>. */
2348# if @REPLACE_USLEEP@ 2363# if @REPLACE_USLEEP@
2349# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 2364# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2350# undef usleep 2365# undef usleep
2351# define usleep rpl_usleep 2366# define usleep rpl_usleep
2352# endif 2367# endif
2353_GL_FUNCDECL_RPL (usleep, int, (useconds_t n)); 2368_GL_FUNCDECL_RPL (usleep, int, (useconds_t n), );
2354_GL_CXXALIAS_RPL (usleep, int, (useconds_t n)); 2369_GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
2355# else 2370# else
2356# if !@HAVE_USLEEP@ 2371# if !@HAVE_USLEEP@
2357_GL_FUNCDECL_SYS (usleep, int, (useconds_t n)); 2372_GL_FUNCDECL_SYS (usleep, int, (useconds_t n), );
2358# endif 2373# endif
2359/* Need to cast, because on Haiku, the first parameter is 2374/* Need to cast, because on Haiku, the first parameter is
2360 unsigned int n. */ 2375 unsigned int n. */
@@ -2362,7 +2377,6 @@ _GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n));
2362# endif 2377# endif
2363_GL_CXXALIASWARN (usleep); 2378_GL_CXXALIASWARN (usleep);
2364#elif defined GNULIB_POSIXCHECK 2379#elif defined GNULIB_POSIXCHECK
2365# undef usleep
2366# if HAVE_RAW_DECL_USLEEP 2380# if HAVE_RAW_DECL_USLEEP
2367_GL_WARN_ON_USE (usleep, "usleep is unportable - " 2381_GL_WARN_ON_USE (usleep, "usleep is unportable - "
2368 "use gnulib module usleep for portability"); 2382 "use gnulib module usleep for portability");
@@ -2379,17 +2393,21 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - "
2379# undef write 2393# undef write
2380# define write rpl_write 2394# define write rpl_write
2381# endif 2395# endif
2382_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count) 2396_GL_FUNCDECL_RPL (write, ssize_t,
2383 _GL_ARG_NONNULL ((2))); 2397 (int fd, const void *buf, size_t count),
2384_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); 2398 _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD);
2399_GL_CXXALIAS_RPL (write, ssize_t,
2400 (int fd, const void *buf, size_t count));
2385# elif defined _WIN32 && !defined __CYGWIN__ 2401# elif defined _WIN32 && !defined __CYGWIN__
2386# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 2402# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2387# undef write 2403# undef write
2388# define write _write 2404# define write _write
2389# endif 2405# endif
2390_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count)); 2406_GL_CXXALIAS_MDA (write, ssize_t,
2407 (int fd, const void *buf, size_t count));
2391# else 2408# else
2392_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); 2409_GL_CXXALIAS_SYS (write, ssize_t,
2410 (int fd, const void *buf, size_t count));
2393# endif 2411# endif
2394_GL_CXXALIASWARN (write); 2412_GL_CXXALIASWARN (write);
2395#elif @GNULIB_MDA_WRITE@ 2413#elif @GNULIB_MDA_WRITE@
@@ -2401,19 +2419,29 @@ _GL_CXXALIASWARN (write);
2401# undef write 2419# undef write
2402# define write _write 2420# define write _write
2403# endif 2421# endif
2404# ifdef __MINGW32__ 2422_GL_CXXALIAS_MDA_CAST (write, ssize_t,
2405_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count)); 2423 (int fd, const void *buf, unsigned int count));
2406# else
2407_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count));
2408# endif
2409# else 2424# else
2410_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); 2425_GL_CXXALIAS_SYS (write, ssize_t,
2426 (int fd, const void *buf, size_t count));
2411# endif 2427# endif
2412_GL_CXXALIASWARN (write); 2428_GL_CXXALIASWARN (write);
2413#endif 2429#endif
2414 2430
2415_GL_INLINE_HEADER_END 2431_GL_INLINE_HEADER_END
2416 2432
2433
2434/* Includes that provide only macros that don't need to be overridden.
2435 (Includes that are needed for type definitions and function declarations
2436 have their place above, before the function overrides.) */
2437
2438/* FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, Solaris 11.4, and glibc 2.41
2439 do not define O_CLOEXEC in <unistd.h>. */
2440#if ! defined O_CLOEXEC
2441# include <fcntl.h>
2442#endif
2443
2444
2417#endif /* _@GUARD_PREFIX@_UNISTD_H */ 2445#endif /* _@GUARD_PREFIX@_UNISTD_H */
2418#endif /* _GL_INCLUDING_UNISTD_H */ 2446#endif /* _GL_INCLUDING_UNISTD_H */
2419#endif /* _@GUARD_PREFIX@_UNISTD_H */ 2447#endif /* _@GUARD_PREFIX@_UNISTD_H */