diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-10-31 15:27:12 (GMT) |
---|---|---|
committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-10-31 15:27:12 (GMT) |
commit | 5be04ec2ceb1df77afbca4fcbf9e92a712612d6f (patch) | |
tree | 2b2e1c71dffae827c8e45cd4cccc375093d03486 /gl/unistd.in.h | |
parent | 6d1d1dac32841d5ca6ee51bb09b30a6c604b17e2 (diff) | |
download | monitoring-plugins-5be04ec2ceb1df77afbca4fcbf9e92a712612d6f.tar.gz |
Sync with the latest Gnulib code (d4ec02b3cc)refs/pull/2037/head
Diffstat (limited to 'gl/unistd.in.h')
-rw-r--r-- | gl/unistd.in.h | 140 |
1 files changed, 115 insertions, 25 deletions
diff --git a/gl/unistd.in.h b/gl/unistd.in.h index 4812fdb..b412966 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-2023 Free Software Foundation, Inc. | 2 | Copyright (C) 2003-2024 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 |
@@ -40,6 +40,24 @@ | |||
40 | # undef _GL_INCLUDING_UNISTD_H | 40 | # undef _GL_INCLUDING_UNISTD_H |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | /* Avoid lseek bugs in FreeBSD, macOS <https://bugs.gnu.org/61386>. | ||
44 | This bug is fixed after FreeBSD 13; see <https://bugs.freebsd.org/256205>. | ||
45 | Use macOS "9999" to stand for a future fixed macOS version. */ | ||
46 | #if defined __FreeBSD__ && __FreeBSD__ < 14 | ||
47 | # undef SEEK_DATA | ||
48 | # undef SEEK_HOLE | ||
49 | #elif defined __APPLE__ && defined __MACH__ && defined SEEK_DATA | ||
50 | # ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ | ||
51 | # include <AvailabilityMacros.h> | ||
52 | # endif | ||
53 | # if (!defined MAC_OS_X_VERSION_MIN_REQUIRED \ | ||
54 | || MAC_OS_X_VERSION_MIN_REQUIRED < 99990000) | ||
55 | # include <sys/fcntl.h> /* It also defines the two macros. */ | ||
56 | # undef SEEK_DATA | ||
57 | # undef SEEK_HOLE | ||
58 | # endif | ||
59 | #endif | ||
60 | |||
43 | /* Get all possible declarations of gethostname(). */ | 61 | /* Get all possible declarations of gethostname(). */ |
44 | #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ | 62 | #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ |
45 | && !defined _GL_INCLUDING_WINSOCK2_H | 63 | && !defined _GL_INCLUDING_WINSOCK2_H |
@@ -51,6 +69,12 @@ | |||
51 | #if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H | 69 | #if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H |
52 | #define _@GUARD_PREFIX@_UNISTD_H | 70 | #define _@GUARD_PREFIX@_UNISTD_H |
53 | 71 | ||
72 | /* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK, | ||
73 | HAVE_RAW_DECL_*. */ | ||
74 | #if !_GL_CONFIG_H_INCLUDED | ||
75 | #error "Please include config.h first." | ||
76 | #endif | ||
77 | |||
54 | /* NetBSD 5.0 mis-defines NULL. Also get size_t. */ | 78 | /* NetBSD 5.0 mis-defines NULL. Also get size_t. */ |
55 | /* But avoid namespace pollution on glibc systems. */ | 79 | /* But avoid namespace pollution on glibc systems. */ |
56 | #ifndef __GLIBC__ | 80 | #ifndef __GLIBC__ |
@@ -152,9 +176,6 @@ | |||
152 | # include <getopt-pfx-core.h> | 176 | # include <getopt-pfx-core.h> |
153 | #endif | 177 | #endif |
154 | 178 | ||
155 | #ifndef _GL_INLINE_HEADER_BEGIN | ||
156 | #error "Please include config.h first." | ||
157 | #endif | ||
158 | _GL_INLINE_HEADER_BEGIN | 179 | _GL_INLINE_HEADER_BEGIN |
159 | #ifndef _GL_UNISTD_INLINE | 180 | #ifndef _GL_UNISTD_INLINE |
160 | # define _GL_UNISTD_INLINE _GL_INLINE | 181 | # define _GL_UNISTD_INLINE _GL_INLINE |
@@ -541,17 +562,22 @@ _GL_CXXALIASWARN (dup2); | |||
541 | Return newfd if successful, otherwise -1 and errno set. | 562 | Return newfd if successful, otherwise -1 and errno set. |
542 | See the Linux man page at | 563 | See the Linux man page at |
543 | <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */ | 564 | <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */ |
544 | # if @HAVE_DUP3@ | 565 | # if @REPLACE_DUP3@ |
545 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 566 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
567 | # undef dup3 | ||
546 | # define dup3 rpl_dup3 | 568 | # define dup3 rpl_dup3 |
547 | # endif | 569 | # endif |
548 | _GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags)); | 570 | _GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags)); |
549 | _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags)); | 571 | _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags)); |
550 | # else | 572 | # else |
573 | # if !@HAVE_DUP3@ | ||
551 | _GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags)); | 574 | _GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags)); |
575 | # endif | ||
552 | _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags)); | 576 | _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags)); |
553 | # endif | 577 | # endif |
578 | # if __GLIBC__ >= 2 | ||
554 | _GL_CXXALIASWARN (dup3); | 579 | _GL_CXXALIASWARN (dup3); |
580 | # endif | ||
555 | #elif defined GNULIB_POSIXCHECK | 581 | #elif defined GNULIB_POSIXCHECK |
556 | # undef dup3 | 582 | # undef dup3 |
557 | # if HAVE_RAW_DECL_DUP3 | 583 | # if HAVE_RAW_DECL_DUP3 |
@@ -870,7 +896,9 @@ _GL_FUNCDECL_SYS (execvpe, int, | |||
870 | _GL_CXXALIAS_SYS (execvpe, int, | 896 | _GL_CXXALIAS_SYS (execvpe, int, |
871 | (const char *program, char * const *argv, char * const *env)); | 897 | (const char *program, char * const *argv, char * const *env)); |
872 | # endif | 898 | # endif |
899 | # if __GLIBC__ >= 2 | ||
873 | _GL_CXXALIASWARN (execvpe); | 900 | _GL_CXXALIASWARN (execvpe); |
901 | # endif | ||
874 | #elif defined GNULIB_POSIXCHECK | 902 | #elif defined GNULIB_POSIXCHECK |
875 | # undef execvpe | 903 | # undef execvpe |
876 | # if HAVE_RAW_DECL_EXECVPE | 904 | # if HAVE_RAW_DECL_EXECVPE |
@@ -925,7 +953,9 @@ _GL_FUNCDECL_SYS (faccessat, int, | |||
925 | _GL_CXXALIAS_SYS (faccessat, int, | 953 | _GL_CXXALIAS_SYS (faccessat, int, |
926 | (int fd, char const *file, int mode, int flag)); | 954 | (int fd, char const *file, int mode, int flag)); |
927 | # endif | 955 | # endif |
956 | # if __GLIBC__ >= 2 | ||
928 | _GL_CXXALIASWARN (faccessat); | 957 | _GL_CXXALIASWARN (faccessat); |
958 | # endif | ||
929 | #elif defined GNULIB_POSIXCHECK | 959 | #elif defined GNULIB_POSIXCHECK |
930 | # undef faccessat | 960 | # undef faccessat |
931 | # if HAVE_RAW_DECL_FACCESSAT | 961 | # if HAVE_RAW_DECL_FACCESSAT |
@@ -941,23 +971,28 @@ _GL_WARN_ON_USE (faccessat, "faccessat is not portable - " | |||
941 | Return 0 if successful, otherwise -1 and errno set. | 971 | Return 0 if successful, otherwise -1 and errno set. |
942 | See the POSIX:2008 specification | 972 | See the POSIX:2008 specification |
943 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */ | 973 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */ |
944 | # if ! @HAVE_FCHDIR@ | 974 | # if @REPLACE_FCHDIR@ |
975 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
976 | # undef fchdir | ||
977 | # define fchdir rpl_fchdir | ||
978 | # endif | ||
979 | _GL_FUNCDECL_RPL (fchdir, int, (int /*fd*/)); | ||
980 | _GL_CXXALIAS_RPL (fchdir, int, (int /*fd*/)); | ||
981 | # else | ||
982 | # if !@HAVE_FCHDIR@ || !@HAVE_DECL_FCHDIR@ | ||
945 | _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); | 983 | _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); |
946 | 984 | # endif | |
985 | _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/)); | ||
986 | # endif | ||
987 | _GL_CXXALIASWARN (fchdir); | ||
988 | # if @REPLACE_FCHDIR@ || !@HAVE_FCHDIR@ | ||
947 | /* Gnulib internal hooks needed to maintain the fchdir metadata. */ | 989 | /* Gnulib internal hooks needed to maintain the fchdir metadata. */ |
948 | _GL_EXTERN_C int _gl_register_fd (int fd, const char *filename) | 990 | _GL_EXTERN_C int _gl_register_fd (int fd, const char *filename) |
949 | _GL_ARG_NONNULL ((2)); | 991 | _GL_ARG_NONNULL ((2)); |
950 | _GL_EXTERN_C void _gl_unregister_fd (int fd); | 992 | _GL_EXTERN_C void _gl_unregister_fd (int fd); |
951 | _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd); | 993 | _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd); |
952 | _GL_EXTERN_C const char *_gl_directory_name (int fd); | 994 | _GL_EXTERN_C const char *_gl_directory_name (int fd); |
953 | |||
954 | # else | ||
955 | # if !@HAVE_DECL_FCHDIR@ | ||
956 | _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); | ||
957 | # endif | ||
958 | # endif | 995 | # endif |
959 | _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/)); | ||
960 | _GL_CXXALIASWARN (fchdir); | ||
961 | #elif defined GNULIB_POSIXCHECK | 996 | #elif defined GNULIB_POSIXCHECK |
962 | # undef fchdir | 997 | # undef fchdir |
963 | # if HAVE_RAW_DECL_FCHDIR | 998 | # if HAVE_RAW_DECL_FCHDIR |
@@ -1002,11 +1037,22 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - " | |||
1002 | Return 0 if successful, otherwise -1 and errno set. | 1037 | Return 0 if successful, otherwise -1 and errno set. |
1003 | See POSIX:2008 specification | 1038 | See POSIX:2008 specification |
1004 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */ | 1039 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */ |
1005 | # if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@ | 1040 | # if @REPLACE_FDATASYNC@ |
1041 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
1042 | # undef fdatasync | ||
1043 | # define fdatasync rpl_fdatasync | ||
1044 | # endif | ||
1045 | _GL_FUNCDECL_RPL (fdatasync, int, (int fd)); | ||
1046 | _GL_CXXALIAS_RPL (fdatasync, int, (int fd)); | ||
1047 | # else | ||
1048 | # if !@HAVE_FDATASYNC@|| !@HAVE_DECL_FDATASYNC@ | ||
1006 | _GL_FUNCDECL_SYS (fdatasync, int, (int fd)); | 1049 | _GL_FUNCDECL_SYS (fdatasync, int, (int fd)); |
1007 | # endif | 1050 | # endif |
1008 | _GL_CXXALIAS_SYS (fdatasync, int, (int fd)); | 1051 | _GL_CXXALIAS_SYS (fdatasync, int, (int fd)); |
1052 | # endif | ||
1053 | # if __GLIBC__ >= 2 | ||
1009 | _GL_CXXALIASWARN (fdatasync); | 1054 | _GL_CXXALIASWARN (fdatasync); |
1055 | # endif | ||
1010 | #elif defined GNULIB_POSIXCHECK | 1056 | #elif defined GNULIB_POSIXCHECK |
1011 | # undef fdatasync | 1057 | # undef fdatasync |
1012 | # if HAVE_RAW_DECL_FDATASYNC | 1058 | # if HAVE_RAW_DECL_FDATASYNC |
@@ -1053,7 +1099,9 @@ _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length)); | |||
1053 | # endif | 1099 | # endif |
1054 | _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length)); | 1100 | _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length)); |
1055 | # endif | 1101 | # endif |
1102 | # if __GLIBC__ >= 2 | ||
1056 | _GL_CXXALIASWARN (ftruncate); | 1103 | _GL_CXXALIASWARN (ftruncate); |
1104 | # endif | ||
1057 | #elif defined GNULIB_POSIXCHECK | 1105 | #elif defined GNULIB_POSIXCHECK |
1058 | # undef ftruncate | 1106 | # undef ftruncate |
1059 | # if HAVE_RAW_DECL_FTRUNCATE | 1107 | # if HAVE_RAW_DECL_FTRUNCATE |
@@ -1070,10 +1118,10 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - " | |||
1070 | or SIZE was too small. | 1118 | or SIZE was too small. |
1071 | See the POSIX:2008 specification | 1119 | See the POSIX:2008 specification |
1072 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>. | 1120 | <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>. |
1073 | Additionally, the gnulib module 'getcwd' guarantees the following GNU | 1121 | Additionally, the gnulib module 'getcwd' or 'getcwd-lgpl' guarantees the |
1074 | extension: If BUF is NULL, an array is allocated with 'malloc'; the array | 1122 | following GNU extension: If BUF is NULL, an array is allocated with |
1075 | is SIZE bytes long, unless SIZE == 0, in which case it is as big as | 1123 | 'malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case |
1076 | necessary. */ | 1124 | it is as big as necessary. */ |
1077 | # if @REPLACE_GETCWD@ | 1125 | # if @REPLACE_GETCWD@ |
1078 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 1126 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1079 | # define getcwd rpl_getcwd | 1127 | # define getcwd rpl_getcwd |
@@ -1185,11 +1233,22 @@ _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - " | |||
1185 | 1233 | ||
1186 | #if @GNULIB_GETENTROPY@ | 1234 | #if @GNULIB_GETENTROPY@ |
1187 | /* Fill a buffer with random bytes. */ | 1235 | /* Fill a buffer with random bytes. */ |
1188 | # if !@HAVE_GETENTROPY@ | 1236 | # if @REPLACE_GETENTROPY@ |
1237 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
1238 | # undef getentropy | ||
1239 | # define getentropy rpl_getentropy | ||
1240 | # endif | ||
1241 | _GL_FUNCDECL_RPL (getentropy, int, (void *buffer, size_t length)); | ||
1242 | _GL_CXXALIAS_RPL (getentropy, int, (void *buffer, size_t length)); | ||
1243 | # else | ||
1244 | # if !@HAVE_GETENTROPY@ | ||
1189 | _GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length)); | 1245 | _GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length)); |
1190 | # endif | 1246 | # endif |
1191 | _GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length)); | 1247 | _GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length)); |
1248 | # endif | ||
1249 | # if __GLIBC__ >= 2 | ||
1192 | _GL_CXXALIASWARN (getentropy); | 1250 | _GL_CXXALIASWARN (getentropy); |
1251 | # endif | ||
1193 | #elif defined GNULIB_POSIXCHECK | 1252 | #elif defined GNULIB_POSIXCHECK |
1194 | # undef getentropy | 1253 | # undef getentropy |
1195 | # if HAVE_RAW_DECL_GETENTROPY | 1254 | # if HAVE_RAW_DECL_GETENTROPY |
@@ -1323,7 +1382,9 @@ _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size) | |||
1323 | int size. */ | 1382 | int size. */ |
1324 | _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size)); | 1383 | _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size)); |
1325 | # endif | 1384 | # endif |
1385 | # if __GLIBC__ >= 2 | ||
1326 | _GL_CXXALIASWARN (getlogin_r); | 1386 | _GL_CXXALIASWARN (getlogin_r); |
1387 | # endif | ||
1327 | #elif defined GNULIB_POSIXCHECK | 1388 | #elif defined GNULIB_POSIXCHECK |
1328 | # undef getlogin_r | 1389 | # undef getlogin_r |
1329 | # if HAVE_RAW_DECL_GETLOGIN_R | 1390 | # if HAVE_RAW_DECL_GETLOGIN_R |
@@ -1661,7 +1722,9 @@ _GL_CXXALIAS_SYS (linkat, int, | |||
1661 | (int fd1, const char *path1, int fd2, const char *path2, | 1722 | (int fd1, const char *path1, int fd2, const char *path2, |
1662 | int flag)); | 1723 | int flag)); |
1663 | # endif | 1724 | # endif |
1725 | # if __GLIBC__ >= 2 | ||
1664 | _GL_CXXALIASWARN (linkat); | 1726 | _GL_CXXALIASWARN (linkat); |
1727 | # endif | ||
1665 | #elif defined GNULIB_POSIXCHECK | 1728 | #elif defined GNULIB_POSIXCHECK |
1666 | # undef linkat | 1729 | # undef linkat |
1667 | # if HAVE_RAW_DECL_LINKAT | 1730 | # if HAVE_RAW_DECL_LINKAT |
@@ -1742,8 +1805,9 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - " | |||
1742 | Return 0 upon success, or -1 with errno set upon failure. | 1805 | Return 0 upon success, or -1 with errno set upon failure. |
1743 | See also the Linux man page at | 1806 | See also the Linux man page at |
1744 | <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */ | 1807 | <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */ |
1745 | # if @HAVE_PIPE2@ | 1808 | # if @REPLACE_PIPE2@ |
1746 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 1809 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
1810 | # undef pipe2 | ||
1747 | # define pipe2 rpl_pipe2 | 1811 | # define pipe2 rpl_pipe2 |
1748 | # endif | 1812 | # endif |
1749 | _GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); | 1813 | _GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); |
@@ -1752,7 +1816,9 @@ _GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags)); | |||
1752 | _GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); | 1816 | _GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); |
1753 | _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags)); | 1817 | _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags)); |
1754 | # endif | 1818 | # endif |
1819 | # if __GLIBC__ >= 2 | ||
1755 | _GL_CXXALIASWARN (pipe2); | 1820 | _GL_CXXALIASWARN (pipe2); |
1821 | # endif | ||
1756 | #elif defined GNULIB_POSIXCHECK | 1822 | #elif defined GNULIB_POSIXCHECK |
1757 | # undef pipe2 | 1823 | # undef pipe2 |
1758 | # if HAVE_RAW_DECL_PIPE2 | 1824 | # if HAVE_RAW_DECL_PIPE2 |
@@ -1787,7 +1853,9 @@ _GL_FUNCDECL_SYS (pread, ssize_t, | |||
1787 | _GL_CXXALIAS_SYS (pread, ssize_t, | 1853 | _GL_CXXALIAS_SYS (pread, ssize_t, |
1788 | (int fd, void *buf, size_t bufsize, off_t offset)); | 1854 | (int fd, void *buf, size_t bufsize, off_t offset)); |
1789 | # endif | 1855 | # endif |
1856 | # if __GLIBC__ >= 2 | ||
1790 | _GL_CXXALIASWARN (pread); | 1857 | _GL_CXXALIASWARN (pread); |
1858 | # endif | ||
1791 | #elif defined GNULIB_POSIXCHECK | 1859 | #elif defined GNULIB_POSIXCHECK |
1792 | # undef pread | 1860 | # undef pread |
1793 | # if HAVE_RAW_DECL_PREAD | 1861 | # if HAVE_RAW_DECL_PREAD |
@@ -1822,7 +1890,9 @@ _GL_FUNCDECL_SYS (pwrite, ssize_t, | |||
1822 | _GL_CXXALIAS_SYS (pwrite, ssize_t, | 1890 | _GL_CXXALIAS_SYS (pwrite, ssize_t, |
1823 | (int fd, const void *buf, size_t bufsize, off_t offset)); | 1891 | (int fd, const void *buf, size_t bufsize, off_t offset)); |
1824 | # endif | 1892 | # endif |
1893 | # if __GLIBC__ >= 2 | ||
1825 | _GL_CXXALIASWARN (pwrite); | 1894 | _GL_CXXALIASWARN (pwrite); |
1895 | # endif | ||
1826 | #elif defined GNULIB_POSIXCHECK | 1896 | #elif defined GNULIB_POSIXCHECK |
1827 | # undef pwrite | 1897 | # undef pwrite |
1828 | # if HAVE_RAW_DECL_PWRITE | 1898 | # if HAVE_RAW_DECL_PWRITE |
@@ -1936,7 +2006,9 @@ _GL_CXXALIAS_SYS (readlinkat, ssize_t, | |||
1936 | (int fd, char const *restrict file, | 2006 | (int fd, char const *restrict file, |
1937 | char *restrict buf, size_t len)); | 2007 | char *restrict buf, size_t len)); |
1938 | # endif | 2008 | # endif |
2009 | # if __GLIBC__ >= 2 | ||
1939 | _GL_CXXALIASWARN (readlinkat); | 2010 | _GL_CXXALIASWARN (readlinkat); |
2011 | # endif | ||
1940 | #elif defined GNULIB_POSIXCHECK | 2012 | #elif defined GNULIB_POSIXCHECK |
1941 | # undef readlinkat | 2013 | # undef readlinkat |
1942 | # if HAVE_RAW_DECL_READLINKAT | 2014 | # if HAVE_RAW_DECL_READLINKAT |
@@ -1996,15 +2068,27 @@ _GL_CXXALIASWARN (rmdir); | |||
1996 | 2068 | ||
1997 | Platforms with no ability to set the hostname return -1 and set | 2069 | Platforms with no ability to set the hostname return -1 and set |
1998 | errno = ENOSYS. */ | 2070 | errno = ENOSYS. */ |
1999 | # if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@ | 2071 | # if @REPLACE_SETHOSTNAME@ |
2072 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
2073 | # undef sethostname | ||
2074 | # define sethostname rpl_sethostname | ||
2075 | # endif | ||
2076 | _GL_FUNCDECL_RPL (sethostname, int, (const char *name, size_t len) | ||
2077 | _GL_ARG_NONNULL ((1))); | ||
2078 | _GL_CXXALIAS_RPL (sethostname, int, (const char *name, size_t len)); | ||
2079 | # else | ||
2080 | # if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@ | ||
2000 | _GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) | 2081 | _GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) |
2001 | _GL_ARG_NONNULL ((1))); | 2082 | _GL_ARG_NONNULL ((1))); |
2002 | # endif | 2083 | # endif |
2003 | /* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 | 2084 | /* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 |
2004 | and FreeBSD 6.4 the second parameter is int. On Solaris 11 | 2085 | and FreeBSD 6.4 the second parameter is int. On Solaris 11 |
2005 | 2011-10, the first parameter is not const. */ | 2086 | 2011-10, the first parameter is not const. */ |
2006 | _GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); | 2087 | _GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); |
2088 | # endif | ||
2089 | # if __GLIBC__ >= 2 | ||
2007 | _GL_CXXALIASWARN (sethostname); | 2090 | _GL_CXXALIASWARN (sethostname); |
2091 | # endif | ||
2008 | #elif defined GNULIB_POSIXCHECK | 2092 | #elif defined GNULIB_POSIXCHECK |
2009 | # undef sethostname | 2093 | # undef sethostname |
2010 | # if HAVE_RAW_DECL_SETHOSTNAME | 2094 | # if HAVE_RAW_DECL_SETHOSTNAME |
@@ -2113,7 +2197,9 @@ _GL_FUNCDECL_SYS (symlinkat, int, | |||
2113 | _GL_CXXALIAS_SYS (symlinkat, int, | 2197 | _GL_CXXALIAS_SYS (symlinkat, int, |
2114 | (char const *contents, int fd, char const *file)); | 2198 | (char const *contents, int fd, char const *file)); |
2115 | # endif | 2199 | # endif |
2200 | # if __GLIBC__ >= 2 | ||
2116 | _GL_CXXALIASWARN (symlinkat); | 2201 | _GL_CXXALIASWARN (symlinkat); |
2202 | # endif | ||
2117 | #elif defined GNULIB_POSIXCHECK | 2203 | #elif defined GNULIB_POSIXCHECK |
2118 | # undef symlinkat | 2204 | # undef symlinkat |
2119 | # if HAVE_RAW_DECL_SYMLINKAT | 2205 | # if HAVE_RAW_DECL_SYMLINKAT |
@@ -2143,7 +2229,9 @@ _GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length) | |||
2143 | # endif | 2229 | # endif |
2144 | _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); | 2230 | _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); |
2145 | # endif | 2231 | # endif |
2232 | # if __GLIBC__ >= 2 | ||
2146 | _GL_CXXALIASWARN (truncate); | 2233 | _GL_CXXALIASWARN (truncate); |
2234 | # endif | ||
2147 | #elif defined GNULIB_POSIXCHECK | 2235 | #elif defined GNULIB_POSIXCHECK |
2148 | # undef truncate | 2236 | # undef truncate |
2149 | # if HAVE_RAW_DECL_TRUNCATE | 2237 | # if HAVE_RAW_DECL_TRUNCATE |
@@ -2173,7 +2261,9 @@ _GL_FUNCDECL_SYS (ttyname_r, int, | |||
2173 | _GL_CXXALIAS_SYS (ttyname_r, int, | 2261 | _GL_CXXALIAS_SYS (ttyname_r, int, |
2174 | (int fd, char *buf, size_t buflen)); | 2262 | (int fd, char *buf, size_t buflen)); |
2175 | # endif | 2263 | # endif |
2264 | # if __GLIBC__ >= 2 | ||
2176 | _GL_CXXALIASWARN (ttyname_r); | 2265 | _GL_CXXALIASWARN (ttyname_r); |
2266 | # endif | ||
2177 | #elif defined GNULIB_POSIXCHECK | 2267 | #elif defined GNULIB_POSIXCHECK |
2178 | # undef ttyname_r | 2268 | # undef ttyname_r |
2179 | # if HAVE_RAW_DECL_TTYNAME_R | 2269 | # if HAVE_RAW_DECL_TTYNAME_R |