diff options
Diffstat (limited to 'lib/unistd.in.h')
-rw-r--r-- | lib/unistd.in.h | 391 |
1 files changed, 226 insertions, 165 deletions
diff --git a/lib/unistd.in.h b/lib/unistd.in.h index b4129663..20b1356f 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -69,8 +69,8 @@ #if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H #define _@GUARD_PREFIX@_UNISTD_H -/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK, - HAVE_RAW_DECL_*. */ +/* This file uses _GL_ATTRIBUTE_NODISCARD, _GL_INLINE_HEADER_BEGIN, _GL_INLINE, + GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */ #if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif @@ -159,8 +159,9 @@ #endif /* MSVC defines off_t in <sys/types.h>. - May also define off_t to a 64-bit type on native Windows. */ -/* Get off_t, ssize_t, mode_t. */ + May also define off_t to a 64-bit type on native Windows. + Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */ +/* Get off_t, off64_t, ssize_t, mode_t. */ #include <sys/types.h> /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -286,7 +287,7 @@ _GL_INLINE_HEADER_BEGIN # undef access # define access rpl_access # endif -_GL_FUNCDECL_RPL (access, int, (const char *file, int mode) +_GL_FUNCDECL_RPL (access, int, (const char *file, int mode), _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (access, int, (const char *file, int mode)); # elif defined _WIN32 && !defined __CYGWIN__ @@ -339,7 +340,7 @@ _GL_CXXALIASWARN (chdir); #elif defined GNULIB_POSIXCHECK # undef chdir # if HAVE_RAW_DECL_CHDIR -_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - " +_GL_WARN_ON_USE (chdir, "chdir is not always in <unistd.h> - " "use gnulib module chdir for portability"); # endif #elif @GNULIB_MDA_CHDIR@ @@ -370,13 +371,13 @@ _GL_CXXALIASWARN (chdir); # undef chown # define chown rpl_chown # endif -_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid) - _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)); # else # if !@HAVE_CHOWN@ -_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid) - _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)); # endif @@ -398,7 +399,7 @@ _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and " # undef close # define close rpl_close # endif -_GL_FUNCDECL_RPL (close, int, (int fd)); +_GL_FUNCDECL_RPL (close, int, (int fd), ); _GL_CXXALIAS_RPL (close, int, (int fd)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -411,8 +412,10 @@ _GL_CXXALIAS_SYS (close, int, (int fd)); # endif _GL_CXXALIASWARN (close); #elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ -# undef close -# define close close_used_without_requesting_gnulib_module_close +# if !GNULIB_CLOSE +# undef close +# define close close_used_without_requesting_gnulib_module_close +# endif #elif defined GNULIB_POSIXCHECK # undef close /* Assume close is always declared. */ @@ -443,7 +446,7 @@ _GL_CXXALIASWARN (close); # endif _GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, - size_t len, unsigned flags)); + size_t len, unsigned flags), ); _GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, size_t len, unsigned flags)); @@ -451,7 +454,7 @@ _GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, # if !@HAVE_COPY_FILE_RANGE@ _GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, - size_t len, unsigned flags)); + size_t len, unsigned flags), ); # endif _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, @@ -473,7 +476,7 @@ _GL_WARN_ON_USE (copy_file_range, # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define dup rpl_dup # endif -_GL_FUNCDECL_RPL (dup, int, (int oldfd)); +_GL_FUNCDECL_RPL (dup, int, (int oldfd), _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (dup, int, (int oldfd)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -518,7 +521,7 @@ _GL_CXXALIASWARN (dup); # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define dup2 rpl_dup2 # endif -_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd)); +_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd), ); _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -567,11 +570,11 @@ _GL_CXXALIASWARN (dup2); # undef dup3 # define dup3 rpl_dup3 # endif -_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags)); +_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags), ); _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags)); # else # if !@HAVE_DUP3@ -_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags)); +_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags), ); # endif _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags)); # endif @@ -636,7 +639,7 @@ rpl_environ (void) /* Like access(), except that it uses the effective user id and group id of the current process. */ # if !@HAVE_EUIDACCESS@ -_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode) +_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode), _GL_ARG_NONNULL ((1))); # endif _GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode)); @@ -661,7 +664,7 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - " # undef execl # define execl rpl_execl # endif -_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...) +_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...), _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...)); # else @@ -696,7 +699,7 @@ _GL_CXXALIASWARN (execl); # undef execle # define execle rpl_execle # endif -_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...) +_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...), _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...)); # else @@ -732,7 +735,7 @@ _GL_CXXALIASWARN (execle); # undef execlp # define execlp rpl_execlp # endif -_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...) +_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...), _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...)); # else @@ -769,7 +772,7 @@ _GL_CXXALIASWARN (execlp); # undef execv # define execv rpl_execv # endif -_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv) +_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv), _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv)); # else @@ -806,7 +809,7 @@ _GL_CXXALIASWARN (execv); # define execve rpl_execve # endif _GL_FUNCDECL_RPL (execve, int, - (const char *program, char * const *argv, char * const *env) + (const char *program, char * const *argv, char * const *env), _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (execve, int, (const char *program, char * const *argv, char * const *env)); @@ -846,7 +849,7 @@ _GL_CXXALIASWARN (execve); # undef execvp # define execvp rpl_execvp # endif -_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv) +_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv), _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv)); # else @@ -883,14 +886,14 @@ _GL_CXXALIASWARN (execvp); # define execvpe rpl_execvpe # endif _GL_FUNCDECL_RPL (execvpe, int, - (const char *program, char * const *argv, char * const *env) + (const char *program, char * const *argv, char * const *env), _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (execvpe, int, (const char *program, char * const *argv, char * const *env)); # else # if !@HAVE_DECL_EXECVPE@ _GL_FUNCDECL_SYS (execvpe, int, - (const char *program, char * const *argv, char * const *env) + (const char *program, char * const *argv, char * const *env), _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (execvpe, int, @@ -921,7 +924,7 @@ _GL_CXXALIAS_MDA_CAST (execvpe, intptr_t, # elif @HAVE_EXECVPE@ # if !@HAVE_DECL_EXECVPE@ _GL_FUNCDECL_SYS (execvpe, int, - (const char *program, char * const *argv, char * const *env) + (const char *program, char * const *argv, char * const *env), _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (execvpe, int, @@ -940,15 +943,15 @@ _GL_CXXALIASWARN (execvpe); # define faccessat rpl_faccessat # endif _GL_FUNCDECL_RPL (faccessat, int, - (int fd, char const *name, int mode, int flag) - _GL_ARG_NONNULL ((2))); + (int fd, char const *name, int mode, int flag), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (faccessat, int, (int fd, char const *name, int mode, int flag)); # else # if !@HAVE_FACCESSAT@ _GL_FUNCDECL_SYS (faccessat, int, - (int fd, char const *file, int mode, int flag) - _GL_ARG_NONNULL ((2))); + (int fd, char const *file, int mode, int flag), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (faccessat, int, (int fd, char const *file, int mode, int flag)); @@ -976,11 +979,11 @@ _GL_WARN_ON_USE (faccessat, "faccessat is not portable - " # undef fchdir # define fchdir rpl_fchdir # endif -_GL_FUNCDECL_RPL (fchdir, int, (int /*fd*/)); +_GL_FUNCDECL_RPL (fchdir, int, (int /*fd*/), _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (fchdir, int, (int /*fd*/)); # else # if !@HAVE_FCHDIR@ || !@HAVE_DECL_FCHDIR@ -_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); +_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/), _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/)); # endif @@ -1009,15 +1012,15 @@ _GL_WARN_ON_USE (fchdir, "fchdir is unportable - " # define fchownat rpl_fchownat # endif _GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file, - uid_t owner, gid_t group, int flag) - _GL_ARG_NONNULL ((2))); + uid_t owner, gid_t group, int flag), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file, uid_t owner, gid_t group, int flag)); # else # if !@HAVE_FCHOWNAT@ _GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file, - uid_t owner, gid_t group, int flag) - _GL_ARG_NONNULL ((2))); + uid_t owner, gid_t group, int flag), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file, uid_t owner, gid_t group, int flag)); @@ -1042,11 +1045,11 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - " # undef fdatasync # define fdatasync rpl_fdatasync # endif -_GL_FUNCDECL_RPL (fdatasync, int, (int fd)); +_GL_FUNCDECL_RPL (fdatasync, int, (int fd), ); _GL_CXXALIAS_RPL (fdatasync, int, (int fd)); # else # if !@HAVE_FDATASYNC@|| !@HAVE_DECL_FDATASYNC@ -_GL_FUNCDECL_SYS (fdatasync, int, (int fd)); +_GL_FUNCDECL_SYS (fdatasync, int, (int fd), ); # endif _GL_CXXALIAS_SYS (fdatasync, int, (int fd)); # endif @@ -1068,7 +1071,7 @@ _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - " See POSIX:2008 specification <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */ # if !@HAVE_FSYNC@ -_GL_FUNCDECL_SYS (fsync, int, (int fd)); +_GL_FUNCDECL_SYS (fsync, int, (int fd), ); # endif _GL_CXXALIAS_SYS (fsync, int, (int fd)); _GL_CXXALIASWARN (fsync); @@ -1091,13 +1094,17 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - " # undef ftruncate # define ftruncate rpl_ftruncate # endif -_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length)); -_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length)); +_GL_FUNCDECL_RPL (ftruncate, int, + (int fd, off_t length), _GL_ATTRIBUTE_NODISCARD); +_GL_CXXALIAS_RPL (ftruncate, int, + (int fd, off_t length)); # else # if !@HAVE_FTRUNCATE@ -_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length)); +_GL_FUNCDECL_SYS (ftruncate, int, + (int fd, off_t length), _GL_ATTRIBUTE_NODISCARD); # endif -_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length)); +_GL_CXXALIAS_SYS (ftruncate, int, + (int fd, off_t length)); # endif # if __GLIBC__ >= 2 _GL_CXXALIASWARN (ftruncate); @@ -1126,7 +1133,8 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define getcwd rpl_getcwd # endif -_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size)); +_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size), + _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1181,15 +1189,19 @@ _GL_CXXALIASWARN (getcwd); # undef getdomainname # define getdomainname rpl_getdomainname # endif -_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len) - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len)); +_GL_FUNCDECL_RPL (getdomainname, int, + (char *name, size_t len), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); +_GL_CXXALIAS_RPL (getdomainname, int, + (char *name, size_t len)); # else # if !@HAVE_DECL_GETDOMAINNAME@ -_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len) - _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_SYS (getdomainname, int, + (char *name, size_t len), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); # endif -_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len)); +_GL_CXXALIAS_SYS (getdomainname, int, + (char *name, size_t len)); # endif # if __GLIBC__ >= 2 _GL_CXXALIASWARN (getdomainname); @@ -1211,11 +1223,11 @@ _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - " # undef getdtablesize # define getdtablesize rpl_getdtablesize # endif -_GL_FUNCDECL_RPL (getdtablesize, int, (void)); +_GL_FUNCDECL_RPL (getdtablesize, int, (void), ); _GL_CXXALIAS_RPL (getdtablesize, int, (void)); # else # if !@HAVE_GETDTABLESIZE@ -_GL_FUNCDECL_SYS (getdtablesize, int, (void)); +_GL_FUNCDECL_SYS (getdtablesize, int, (void), ); # endif /* Need to cast, because on AIX, the parameter list is (...). */ @@ -1238,13 +1250,17 @@ _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - " # undef getentropy # define getentropy rpl_getentropy # endif -_GL_FUNCDECL_RPL (getentropy, int, (void *buffer, size_t length)); -_GL_CXXALIAS_RPL (getentropy, int, (void *buffer, size_t length)); +_GL_FUNCDECL_RPL (getentropy, int, + (void *buffer, size_t length), _GL_ATTRIBUTE_NODISCARD); +_GL_CXXALIAS_RPL (getentropy, int, + (void *buffer, size_t length)); # else # if !@HAVE_GETENTROPY@ -_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length)); +_GL_FUNCDECL_SYS (getentropy, int, + (void *buffer, size_t length), _GL_ATTRIBUTE_NODISCARD); # endif -_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length)); +_GL_CXXALIAS_SYS (getentropy, int, + (void *buffer, size_t length)); # endif # if __GLIBC__ >= 2 _GL_CXXALIASWARN (getentropy); @@ -1269,13 +1285,17 @@ _GL_WARN_ON_USE (getentropy, "getentropy is unportable - " # undef getgroups # define getgroups rpl_getgroups # endif -_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups)); -_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups)); +_GL_FUNCDECL_RPL (getgroups, int, + (int n, gid_t *groups), _GL_ATTRIBUTE_NODISCARD); +_GL_CXXALIAS_RPL (getgroups, int, + (int n, gid_t *groups)); # else # if !@HAVE_GETGROUPS@ -_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups)); +_GL_FUNCDECL_SYS (getgroups, int, + (int n, gid_t *groups), _GL_ATTRIBUTE_NODISCARD); # endif -_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups)); +_GL_CXXALIAS_SYS (getgroups, int, + (int n, gid_t *groups)); # endif _GL_CXXALIASWARN (getgroups); #elif defined GNULIB_POSIXCHECK @@ -1300,12 +1320,12 @@ _GL_WARN_ON_USE (getgroups, "getgroups is unportable - " # undef gethostname # define gethostname rpl_gethostname # endif -_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len) +_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len), _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len)); # else # if !@HAVE_GETHOSTNAME@ -_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len) +_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len), _GL_ARG_NONNULL ((1))); # endif /* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second @@ -1315,8 +1335,10 @@ _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len)); # endif _GL_CXXALIASWARN (gethostname); #elif @UNISTD_H_HAVE_WINSOCK2_H@ -# undef gethostname -# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname +# if !GNULIB_GETHOSTNAME +# undef gethostname +# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname +# endif #elif defined GNULIB_POSIXCHECK # undef gethostname # if HAVE_RAW_DECL_GETHOSTNAME @@ -1338,7 +1360,7 @@ _GL_WARN_ON_USE (gethostname, "gethostname is unportable - " $USERNAME on native Windows platforms. */ # if !@HAVE_DECL_GETLOGIN@ -_GL_FUNCDECL_SYS (getlogin, char *, (void)); +_GL_FUNCDECL_SYS (getlogin, char *, (void), ); # endif _GL_CXXALIAS_SYS (getlogin, char *, (void)); _GL_CXXALIASWARN (getlogin); @@ -1370,12 +1392,12 @@ _GL_WARN_ON_USE (getlogin, "getlogin is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define getlogin_r rpl_getlogin_r # endif -_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size) +_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size), _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size)); # else # if !@HAVE_DECL_GETLOGIN_R@ -_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size) +_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size), _GL_ARG_NONNULL ((1))); # endif /* Need to cast, because on Solaris 10 systems, the second argument is @@ -1399,13 +1421,13 @@ _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define getpagesize rpl_getpagesize # endif -_GL_FUNCDECL_RPL (getpagesize, int, (void)); +_GL_FUNCDECL_RPL (getpagesize, int, (void), ); _GL_CXXALIAS_RPL (getpagesize, int, (void)); # else /* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */ # if defined __hpux -_GL_FUNCDECL_SYS (getpagesize, int, (void)); +_GL_FUNCDECL_SYS (getpagesize, int, (void), ); # endif # if !@HAVE_GETPAGESIZE@ # if !defined getpagesize @@ -1492,12 +1514,12 @@ _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - " # undef getpass # define getpass rpl_getpass # endif -_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt) +_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt), _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (getpass, char *, (const char *prompt)); # else # if !@HAVE_GETPASS@ -_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt) +_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt), _GL_ARG_NONNULL ((1))); # endif _GL_CXXALIAS_SYS (getpass, char *, (const char *prompt)); @@ -1530,12 +1552,21 @@ _GL_CXXALIASWARN (getpid); #if @GNULIB_GETUSERSHELL@ +# if @REPLACE_GETUSERSHELL@ /* Return the next valid login shell on the system, or NULL when the end of the list has been reached. */ -# if !@HAVE_DECL_GETUSERSHELL@ -_GL_FUNCDECL_SYS (getusershell, char *, (void)); -# endif +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getusershell +# define getusershell rpl_getusershell +# endif +_GL_FUNCDECL_RPL (getusershell, char *, (void), ); +_GL_CXXALIAS_RPL (getusershell, char *, (void)); +# else +# if !@HAVE_DECL_GETUSERSHELL@ +_GL_FUNCDECL_SYS (getusershell, char *, (void), ); +# endif _GL_CXXALIAS_SYS (getusershell, char *, (void)); +# endif _GL_CXXALIASWARN (getusershell); #elif defined GNULIB_POSIXCHECK # undef getusershell @@ -1547,10 +1578,19 @@ _GL_WARN_ON_USE (getusershell, "getusershell is unportable - " #if @GNULIB_GETUSERSHELL@ /* Rewind to pointer that is advanced at each getusershell() call. */ -# if !@HAVE_DECL_GETUSERSHELL@ -_GL_FUNCDECL_SYS (setusershell, void, (void)); -# endif +# if @REPLACE_GETUSERSHELL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setusershell +# define setusershell rpl_setusershell +# endif +_GL_FUNCDECL_RPL (setusershell, void, (void), ); +_GL_CXXALIAS_RPL (setusershell, void, (void)); +# else +# if !@HAVE_DECL_GETUSERSHELL@ +_GL_FUNCDECL_SYS (setusershell, void, (void), ); +# endif _GL_CXXALIAS_SYS (setusershell, void, (void)); +# endif _GL_CXXALIASWARN (setusershell); #elif defined GNULIB_POSIXCHECK # undef setusershell @@ -1563,10 +1603,19 @@ _GL_WARN_ON_USE (setusershell, "setusershell is unportable - " #if @GNULIB_GETUSERSHELL@ /* Free the pointer that is advanced at each getusershell() call and associated resources. */ -# if !@HAVE_DECL_GETUSERSHELL@ -_GL_FUNCDECL_SYS (endusershell, void, (void)); -# endif +# if @REPLACE_GETUSERSHELL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef endusershell +# define endusershell rpl_endusershell +# endif +_GL_FUNCDECL_RPL (endusershell, void, (void), ); +_GL_CXXALIAS_RPL (endusershell, void, (void)); +# else +# if !@HAVE_DECL_GETUSERSHELL@ +_GL_FUNCDECL_SYS (endusershell, void, (void), ); +# endif _GL_CXXALIAS_SYS (endusershell, void, (void)); +# endif _GL_CXXALIASWARN (endusershell); #elif defined GNULIB_POSIXCHECK # undef endusershell @@ -1580,7 +1629,7 @@ _GL_WARN_ON_USE (endusershell, "endusershell is unportable - " #if @GNULIB_GROUP_MEMBER@ /* Determine whether group id is in calling user's group list. */ # if !@HAVE_GROUP_MEMBER@ -_GL_FUNCDECL_SYS (group_member, int, (gid_t gid)); +_GL_FUNCDECL_SYS (group_member, int, (gid_t gid), ); # endif _GL_CXXALIAS_SYS (group_member, int, (gid_t gid)); _GL_CXXALIASWARN (group_member); @@ -1600,7 +1649,7 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - " # define isatty rpl_isatty # endif # define GNULIB_defined_isatty 1 -_GL_FUNCDECL_RPL (isatty, int, (int fd)); +_GL_FUNCDECL_RPL (isatty, int, (int fd), ); _GL_CXXALIAS_RPL (isatty, int, (int fd)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1646,13 +1695,13 @@ _GL_CXXALIASWARN (isatty); # undef lchown # define lchown rpl_lchown # endif -_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group) - _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)); # else # if !@HAVE_LCHOWN@ -_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group) - _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)); # endif @@ -1675,13 +1724,13 @@ _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define link rpl_link # endif -_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2) - _GL_ARG_NONNULL ((1, 2))); +_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2), + _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2)); # else # if !@HAVE_LINK@ -_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2) - _GL_ARG_NONNULL ((1, 2))); +_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2), + _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2)); # endif @@ -1706,8 +1755,8 @@ _GL_WARN_ON_USE (link, "link is unportable - " # endif _GL_FUNCDECL_RPL (linkat, int, (int fd1, const char *path1, int fd2, const char *path2, - int flag) - _GL_ARG_NONNULL ((2, 4))); + int flag), + _GL_ARG_NONNULL ((2, 4)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (linkat, int, (int fd1, const char *path1, int fd2, const char *path2, int flag)); @@ -1715,8 +1764,8 @@ _GL_CXXALIAS_RPL (linkat, int, # if !@HAVE_LINKAT@ _GL_FUNCDECL_SYS (linkat, int, (int fd1, const char *path1, int fd2, const char *path2, - int flag) - _GL_ARG_NONNULL ((2, 4))); + int flag), + _GL_ARG_NONNULL ((2, 4)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (linkat, int, (int fd1, const char *path1, int fd2, const char *path2, @@ -1743,7 +1792,7 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define lseek rpl_lseek # endif -_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence)); +_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence), ); _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1783,7 +1832,8 @@ _GL_CXXALIASWARN (lseek); Store the read-end as fd[0] and the write-end as fd[1]. Return 0 upon success, or -1 with errno set upon failure. */ # if !@HAVE_PIPE@ -_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_SYS (pipe, int, (int fd[2]), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (pipe, int, (int fd[2])); _GL_CXXALIASWARN (pipe); @@ -1810,10 +1860,12 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - " # undef pipe2 # define pipe2 rpl_pipe2 # endif -_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags)); # else -_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags)); # endif # if __GLIBC__ >= 2 @@ -1840,15 +1892,15 @@ _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - " # define pread rpl_pread # endif _GL_FUNCDECL_RPL (pread, ssize_t, - (int fd, void *buf, size_t bufsize, off_t offset) - _GL_ARG_NONNULL ((2))); + (int fd, void *buf, size_t bufsize, off_t offset), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (pread, ssize_t, (int fd, void *buf, size_t bufsize, off_t offset)); # else # if !@HAVE_PREAD@ _GL_FUNCDECL_SYS (pread, ssize_t, - (int fd, void *buf, size_t bufsize, off_t offset) - _GL_ARG_NONNULL ((2))); + (int fd, void *buf, size_t bufsize, off_t offset), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (pread, ssize_t, (int fd, void *buf, size_t bufsize, off_t offset)); @@ -1877,15 +1929,15 @@ _GL_WARN_ON_USE (pread, "pread is unportable - " # define pwrite rpl_pwrite # endif _GL_FUNCDECL_RPL (pwrite, ssize_t, - (int fd, const void *buf, size_t bufsize, off_t offset) - _GL_ARG_NONNULL ((2))); + (int fd, const void *buf, size_t bufsize, off_t offset), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (pwrite, ssize_t, (int fd, const void *buf, size_t bufsize, off_t offset)); # else # if !@HAVE_PWRITE@ _GL_FUNCDECL_SYS (pwrite, ssize_t, - (int fd, const void *buf, size_t bufsize, off_t offset) - _GL_ARG_NONNULL ((2))); + (int fd, const void *buf, size_t bufsize, off_t offset), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (pwrite, ssize_t, (int fd, const void *buf, size_t bufsize, off_t offset)); @@ -1911,8 +1963,9 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - " # undef read # define read rpl_read # endif -_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count) - _GL_ARG_NONNULL ((2))); + +_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1933,11 +1986,7 @@ _GL_CXXALIASWARN (read); # undef read # define read _read # endif -# ifdef __MINGW32__ -_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count)); -# else -_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count)); -# endif +_GL_CXXALIAS_MDA_CAST (read, ssize_t, (int fd, void *buf, unsigned int count)); # else _GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count)); # endif @@ -1957,8 +2006,8 @@ _GL_CXXALIASWARN (read); # endif _GL_FUNCDECL_RPL (readlink, ssize_t, (const char *restrict file, - char *restrict buf, size_t bufsize) - _GL_ARG_NONNULL ((1, 2))); + char *restrict buf, size_t bufsize), + _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (readlink, ssize_t, (const char *restrict file, char *restrict buf, size_t bufsize)); @@ -1966,8 +2015,8 @@ _GL_CXXALIAS_RPL (readlink, ssize_t, # if !@HAVE_READLINK@ _GL_FUNCDECL_SYS (readlink, ssize_t, (const char *restrict file, - char *restrict buf, size_t bufsize) - _GL_ARG_NONNULL ((1, 2))); + char *restrict buf, size_t bufsize), + _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (readlink, ssize_t, (const char *restrict file, @@ -1990,8 +2039,8 @@ _GL_WARN_ON_USE (readlink, "readlink is unportable - " # endif _GL_FUNCDECL_RPL (readlinkat, ssize_t, (int fd, char const *restrict file, - char *restrict buf, size_t len) - _GL_ARG_NONNULL ((2, 3))); + char *restrict buf, size_t len), + _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (readlinkat, ssize_t, (int fd, char const *restrict file, char *restrict buf, size_t len)); @@ -1999,8 +2048,8 @@ _GL_CXXALIAS_RPL (readlinkat, ssize_t, # if !@HAVE_READLINKAT@ _GL_FUNCDECL_SYS (readlinkat, ssize_t, (int fd, char const *restrict file, - char *restrict buf, size_t len) - _GL_ARG_NONNULL ((2, 3))); + char *restrict buf, size_t len), + _GL_ARG_NONNULL ((2, 3)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (readlinkat, ssize_t, (int fd, char const *restrict file, @@ -2024,7 +2073,7 @@ _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define rmdir rpl_rmdir # endif -_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_RPL (rmdir, int, (char const *name), _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (rmdir, int, (char const *name)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -2073,18 +2122,22 @@ _GL_CXXALIASWARN (rmdir); # undef sethostname # define sethostname rpl_sethostname # endif -_GL_FUNCDECL_RPL (sethostname, int, (const char *name, size_t len) - _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (sethostname, int, (const char *name, size_t len)); +_GL_FUNCDECL_RPL (sethostname, int, + (const char *name, size_t len), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); +_GL_CXXALIAS_RPL (sethostname, int, + (const char *name, size_t len)); # else # if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@ -_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) - _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_SYS (sethostname, int, + (const char *name, size_t len), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); # endif /* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 and FreeBSD 6.4 the second parameter is int. On Solaris 11 2011-10, the first parameter is not const. */ -_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); +_GL_CXXALIAS_SYS_CAST (sethostname, int, + (const char *name, size_t len)); # endif # if __GLIBC__ >= 2 _GL_CXXALIASWARN (sethostname); @@ -2108,11 +2161,11 @@ _GL_WARN_ON_USE (sethostname, "sethostname is unportable - " # undef sleep # define sleep rpl_sleep # endif -_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n)); +_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n), ); _GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n)); # else # if !@HAVE_SLEEP@ -_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n)); +_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n), ); # endif _GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n)); # endif @@ -2157,15 +2210,19 @@ _GL_CXXALIASWARN (swab); # undef symlink # define symlink rpl_symlink # endif -_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file) - _GL_ARG_NONNULL ((1, 2))); -_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file)); +_GL_FUNCDECL_RPL (symlink, int, + (char const *contents, char const *file), + _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD); +_GL_CXXALIAS_RPL (symlink, int, + (char const *contents, char const *file)); # else # if !@HAVE_SYMLINK@ -_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file) - _GL_ARG_NONNULL ((1, 2))); +_GL_FUNCDECL_SYS (symlink, int, + (char const *contents, char const *file), + _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_NODISCARD); # endif -_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file)); +_GL_CXXALIAS_SYS (symlink, int, + (char const *contents, char const *file)); # endif _GL_CXXALIASWARN (symlink); #elif defined GNULIB_POSIXCHECK @@ -2184,15 +2241,15 @@ _GL_WARN_ON_USE (symlink, "symlink is not portable - " # define symlinkat rpl_symlinkat # endif _GL_FUNCDECL_RPL (symlinkat, int, - (char const *contents, int fd, char const *file) - _GL_ARG_NONNULL ((1, 3))); + (char const *contents, int fd, char const *file), + _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (symlinkat, int, (char const *contents, int fd, char const *file)); # else # if !@HAVE_SYMLINKAT@ _GL_FUNCDECL_SYS (symlinkat, int, - (char const *contents, int fd, char const *file) - _GL_ARG_NONNULL ((1, 3))); + (char const *contents, int fd, char const *file), + _GL_ARG_NONNULL ((1, 3)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (symlinkat, int, (char const *contents, int fd, char const *file)); @@ -2219,13 +2276,13 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - " # undef truncate # define truncate rpl_truncate # endif -_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length) - _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length)); # else # if !@HAVE_DECL_TRUNCATE@ -_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length) - _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length), + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); # endif @@ -2250,13 +2307,15 @@ _GL_WARN_ON_USE (truncate, "truncate is unportable - " # define ttyname_r rpl_ttyname_r # endif _GL_FUNCDECL_RPL (ttyname_r, int, - (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); + (int fd, char *buf, size_t buflen), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); _GL_CXXALIAS_RPL (ttyname_r, int, (int fd, char *buf, size_t buflen)); # else # if !@HAVE_DECL_TTYNAME_R@ _GL_FUNCDECL_SYS (ttyname_r, int, - (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); + (int fd, char *buf, size_t buflen), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); # endif _GL_CXXALIAS_SYS (ttyname_r, int, (int fd, char *buf, size_t buflen)); @@ -2279,7 +2338,7 @@ _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - " # undef unlink # define unlink rpl_unlink # endif -_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_RPL (unlink, int, (char const *file), _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (unlink, int, (char const *file)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -2320,12 +2379,12 @@ _GL_CXXALIASWARN (unlink); # undef unlinkat # define unlinkat rpl_unlinkat # endif -_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag) +_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag), _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag)); # else # if !@HAVE_UNLINKAT@ -_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag) +_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag), _GL_ARG_NONNULL ((2))); # endif _GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag)); @@ -2350,11 +2409,11 @@ _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - " # undef usleep # define usleep rpl_usleep # endif -_GL_FUNCDECL_RPL (usleep, int, (useconds_t n)); +_GL_FUNCDECL_RPL (usleep, int, (useconds_t n), ); _GL_CXXALIAS_RPL (usleep, int, (useconds_t n)); # else # if !@HAVE_USLEEP@ -_GL_FUNCDECL_SYS (usleep, int, (useconds_t n)); +_GL_FUNCDECL_SYS (usleep, int, (useconds_t n), ); # endif /* Need to cast, because on Haiku, the first parameter is unsigned int n. */ @@ -2379,17 +2438,21 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - " # undef write # define write rpl_write # endif -_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count) - _GL_ARG_NONNULL ((2))); -_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); +_GL_FUNCDECL_RPL (write, ssize_t, + (int fd, const void *buf, size_t count), + _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_NODISCARD); +_GL_CXXALIAS_RPL (write, ssize_t, + (int fd, const void *buf, size_t count)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef write # define write _write # endif -_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count)); +_GL_CXXALIAS_MDA (write, ssize_t, + (int fd, const void *buf, size_t count)); # else -_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); +_GL_CXXALIAS_SYS (write, ssize_t, + (int fd, const void *buf, size_t count)); # endif _GL_CXXALIASWARN (write); #elif @GNULIB_MDA_WRITE@ @@ -2401,13 +2464,11 @@ _GL_CXXALIASWARN (write); # undef write # define write _write # endif -# ifdef __MINGW32__ -_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count)); -# else -_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count)); -# endif +_GL_CXXALIAS_MDA_CAST (write, ssize_t, + (int fd, const void *buf, unsigned int count)); # else -_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); +_GL_CXXALIAS_SYS (write, ssize_t, + (int fd, const void *buf, size_t count)); # endif _GL_CXXALIASWARN (write); #endif |