19 @PRAGMA_SYSTEM_HEADER@
27 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
28 && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H
32 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
34 # error unexpected; report this to bug-gnulib@gnu.org
36 # define _GL_WINSOCK2_H_WITNESS
39 #elif !defined _@GUARD_PREFIX@_UNISTD_H
43 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
47 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
48 && !defined _GL_INCLUDING_WINSOCK2_H
49 # define _GL_INCLUDING_WINSOCK2_H
50 # include <winsock2.h>
51 # undef _GL_INCLUDING_WINSOCK2_H
54 #if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
55 #define _@GUARD_PREFIX@_UNISTD_H
63 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
64 || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
65 && defined __CYGWIN__)) \
66 && ! defined __GLIBC__
72 #if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \
73 && ! defined __GLIBC__
88 #if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
89 || defined GNULIB_POSIXCHECK) \
90 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
98 #if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
99 || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
100 && !defined __GLIBC__
107 # include <sys/types.h>
110 #if (@GNULIB_READ@ || @GNULIB_WRITE@ \
111 || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
112 || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
114 # include <sys/types.h>
119 #if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
132 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
133 # if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
134 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
136 # define socket socket_used_without_including_sys_socket_h
138 # define connect connect_used_without_including_sys_socket_h
140 # define accept accept_used_without_including_sys_socket_h
142 # define bind bind_used_without_including_sys_socket_h
144 # define getpeername getpeername_used_without_including_sys_socket_h
146 # define getsockname getsockname_used_without_including_sys_socket_h
148 # define getsockopt getsockopt_used_without_including_sys_socket_h
150 # define listen listen_used_without_including_sys_socket_h
152 # define recv recv_used_without_including_sys_socket_h
154 # define send send_used_without_including_sys_socket_h
156 # define recvfrom recvfrom_used_without_including_sys_socket_h
158 # define sendto sendto_used_without_including_sys_socket_h
160 # define setsockopt setsockopt_used_without_including_sys_socket_h
162 # define shutdown shutdown_used_without_including_sys_socket_h
165 "socket() used without including <sys/socket.h>");
167 "connect() used without including <sys/socket.h>");
169 "accept() used without including <sys/socket.h>");
171 "bind() used without including <sys/socket.h>");
173 "getpeername() used without including <sys/socket.h>");
175 "getsockname() used without including <sys/socket.h>");
177 "getsockopt() used without including <sys/socket.h>");
179 "listen() used without including <sys/socket.h>");
181 "recv() used without including <sys/socket.h>");
183 "send() used without including <sys/socket.h>");
185 "recvfrom() used without including <sys/socket.h>");
187 "sendto() used without including <sys/socket.h>");
189 "setsockopt() used without including <sys/socket.h>");
191 "shutdown() used without including <sys/socket.h>");
194 # if !defined _@GUARD_PREFIX@_SYS_SELECT_H
195 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
197 # define select select_used_without_including_sys_select_h
200 "select() used without including <sys/select.h>");
208 # define STDIN_FILENO 0
210 #ifndef STDOUT_FILENO
211 # define STDOUT_FILENO 1
213 #ifndef STDERR_FILENO
214 # define STDERR_FILENO 2
229 #if defined GNULIB_POSIXCHECK
232 "use the gnulib module faccessat instead");
239 #elif defined GNULIB_POSIXCHECK
241 # if HAVE_RAW_DECL_CHDIR
243 "use gnulib module chdir for portability");
255 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
257 # define chown rpl_chown
270 #elif defined GNULIB_POSIXCHECK
272 # if HAVE_RAW_DECL_CHOWN
273 _GL_WARN_ON_USE (chown,
"chown fails to follow symlinks on some systems and "
274 "doesn't treat a uid or gid of -1 on some systems - "
275 "use gnulib module chown for portability");
283 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
285 # define close rpl_close
293 #elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
295 # define close close_used_without_requesting_gnulib_module_close
296 #elif defined GNULIB_POSIXCHECK
300 "use gnulib module close for portability");
306 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
315 #elif defined GNULIB_POSIXCHECK
317 # if HAVE_RAW_DECL_DUP
319 "use gnulib module dup for portability");
331 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
332 # define dup2 rpl_dup2
343 #elif defined GNULIB_POSIXCHECK
345 # if HAVE_RAW_DECL_DUP2
347 "use gnulib module dup2 for portability");
362 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
363 # define dup3 rpl_dup3
372 #elif defined GNULIB_POSIXCHECK
374 # if HAVE_RAW_DECL_DUP3
376 "use gnulib module dup3 for portability");
382 # if !@HAVE_DECL_ENVIRON@
385 # if defined __APPLE__ && defined __MACH__
386 # include <crt_externs.h>
387 # define environ (*_NSGetEnviron ())
392 extern char **environ;
398 #elif defined GNULIB_POSIXCHECK
399 # if HAVE_RAW_DECL_ENVIRON
400 static inline char ***
406 "use gnulib module environ for portability");
408 # define environ (*rpl_environ ())
413 #if @GNULIB_EUIDACCESS@
416 # if !@HAVE_EUIDACCESS@
422 # if defined GNULIB_POSIXCHECK
424 _GL_WARN_ON_USE (euidaccess,
"the euidaccess function is a security risk - "
425 "use the gnulib module faccessat instead");
427 #elif defined GNULIB_POSIXCHECK
429 # if HAVE_RAW_DECL_EUIDACCESS
431 "use gnulib module euidaccess for portability");
436 #if @GNULIB_FACCESSAT@
437 # if !@HAVE_FACCESSAT@
439 (
int fd,
char const *file,
int mode,
int flag)
443 (
int fd,
char const *file,
int mode,
int flag));
445 #elif defined GNULIB_POSIXCHECK
447 # if HAVE_RAW_DECL_FACCESSAT
449 "use gnulib module faccessat for portability");
464 _GL_EXTERN_C int _gl_register_fd (
int fd,
const char *filename)
467 _GL_EXTERN_C int _gl_register_dup (
int oldfd,
int newfd);
471 # if !@HAVE_DECL_FCHDIR@
477 #elif defined GNULIB_POSIXCHECK
479 # if HAVE_RAW_DECL_FCHDIR
481 "use gnulib module fchdir for portability");
486 #if @GNULIB_FCHOWNAT@
487 # if @REPLACE_FCHOWNAT@
488 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
490 # define fchownat rpl_fchownat
493 uid_t
owner, gid_t group,
int flag)
496 uid_t
owner, gid_t group,
int flag));
498 # if !@HAVE_FCHOWNAT@
500 uid_t
owner, gid_t group,
int flag)
504 uid_t
owner, gid_t group,
int flag));
507 #elif defined GNULIB_POSIXCHECK
509 # if HAVE_RAW_DECL_FCHOWNAT
511 "use gnulib module openat for portability");
516 #if @GNULIB_FDATASYNC@
521 # if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@
526 #elif defined GNULIB_POSIXCHECK
528 # if HAVE_RAW_DECL_FDATASYNC
530 "use gnulib module fdatasync for portability");
545 #elif defined GNULIB_POSIXCHECK
547 # if HAVE_RAW_DECL_FSYNC
549 "use gnulib module fsync for portability");
554 #if @GNULIB_FTRUNCATE@
559 # if !@HAVE_FTRUNCATE@
564 #elif defined GNULIB_POSIXCHECK
566 # if HAVE_RAW_DECL_FTRUNCATE
568 "use gnulib module ftruncate for portability");
584 # if @REPLACE_GETCWD@
585 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
586 # define getcwd rpl_getcwd
596 #elif defined GNULIB_POSIXCHECK
598 # if HAVE_RAW_DECL_GETCWD
600 "use gnulib module getcwd for portability");
605 #if @GNULIB_GETDOMAINNAME@
616 # if @REPLACE_GETDOMAINNAME@
617 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
618 # undef getdomainname
619 # define getdomainname rpl_getdomainname
625 # if !@HAVE_DECL_GETDOMAINNAME@
632 #elif defined GNULIB_POSIXCHECK
633 # undef getdomainname
634 # if HAVE_RAW_DECL_GETDOMAINNAME
636 "use gnulib module getdomainname for portability");
641 #if @GNULIB_GETDTABLESIZE@
644 # if !@HAVE_GETDTABLESIZE@
649 #elif defined GNULIB_POSIXCHECK
650 # undef getdtablesize
651 # if HAVE_RAW_DECL_GETDTABLESIZE
653 "use gnulib module getdtablesize for portability");
658 #if @GNULIB_GETGROUPS@
664 # if @REPLACE_GETGROUPS@
665 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
667 # define getgroups rpl_getgroups
672 # if !@HAVE_GETGROUPS@
678 #elif defined GNULIB_POSIXCHECK
680 # if HAVE_RAW_DECL_GETGROUPS
682 "use gnulib module getgroups for portability");
687 #if @GNULIB_GETHOSTNAME@
695 # if @UNISTD_H_HAVE_WINSOCK2_H@
696 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
698 # define gethostname rpl_gethostname
704 # if !@HAVE_GETHOSTNAME@
714 #elif @UNISTD_H_HAVE_WINSOCK2_H@
716 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
717 #elif defined GNULIB_POSIXCHECK
719 # if HAVE_RAW_DECL_GETHOSTNAME
721 "use gnulib module gethostname for portability");
726 #if @GNULIB_GETLOGIN@
737 # if !@HAVE_GETLOGIN@
742 #elif defined GNULIB_POSIXCHECK
744 # if HAVE_RAW_DECL_GETLOGIN
746 "use gnulib module getlogin for portability");
751 #if @GNULIB_GETLOGIN_R@
766 # if @REPLACE_GETLOGIN_R@
767 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
768 # define getlogin_r rpl_getlogin_r
774 # if !@HAVE_DECL_GETLOGIN_R@
783 #elif defined GNULIB_POSIXCHECK
785 # if HAVE_RAW_DECL_GETLOGIN_R
787 "use gnulib module getlogin_r for portability");
792 #if @GNULIB_GETPAGESIZE@
793 # if @REPLACE_GETPAGESIZE@
794 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
795 # define getpagesize rpl_getpagesize
800 # if !@HAVE_GETPAGESIZE@
801 # if !defined getpagesize
803 # if !defined _gl_getpagesize && defined _SC_PAGESIZE
804 # if ! (defined __VMS && __VMS_VER < 70000000)
805 # define _gl_getpagesize() sysconf (_SC_PAGESIZE)
809 # if !defined _gl_getpagesize && defined __VMS
811 # define _gl_getpagesize() 8192
813 # define _gl_getpagesize() 512
817 # if !defined _gl_getpagesize && @HAVE_OS_H@
819 # if defined B_PAGE_SIZE
820 # define _gl_getpagesize() B_PAGE_SIZE
824 # if !defined _gl_getpagesize && defined __amigaos4__
825 # define _gl_getpagesize() 2048
828 # if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
829 # include <sys/param.h>
830 # ifdef EXEC_PAGESIZE
831 # define _gl_getpagesize() EXEC_PAGESIZE
837 # define _gl_getpagesize() (NBPG * CLSIZE)
840 # define _gl_getpagesize() NBPC
845 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
846 # define getpagesize() _gl_getpagesize ()
848 # if !GNULIB_defined_getpagesize_function
852 return _gl_getpagesize ();
854 # define GNULIB_defined_getpagesize_function 1
862 # if @HAVE_DECL_GETPAGESIZE@
865 #elif defined GNULIB_POSIXCHECK
867 # if HAVE_RAW_DECL_GETPAGESIZE
869 "use gnulib module getpagesize for portability");
874 #if @GNULIB_GETUSERSHELL@
877 # if !@HAVE_DECL_GETUSERSHELL@
882 #elif defined GNULIB_POSIXCHECK
884 # if HAVE_RAW_DECL_GETUSERSHELL
886 "use gnulib module getusershell for portability");
890 #if @GNULIB_GETUSERSHELL@
892 # if !@HAVE_DECL_GETUSERSHELL@
897 #elif defined GNULIB_POSIXCHECK
899 # if HAVE_RAW_DECL_SETUSERSHELL
901 "use gnulib module getusershell for portability");
905 #if @GNULIB_GETUSERSHELL@
908 # if !@HAVE_DECL_GETUSERSHELL@
913 #elif defined GNULIB_POSIXCHECK
915 # if HAVE_RAW_DECL_ENDUSERSHELL
917 "use gnulib module getusershell for portability");
922 #if @GNULIB_GROUP_MEMBER@
924 # if !@HAVE_GROUP_MEMBER@
929 #elif defined GNULIB_POSIXCHECK
931 # if HAVE_RAW_DECL_GROUP_MEMBER
933 "use gnulib module group-member for portability");
944 # if @REPLACE_LCHOWN@
945 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
947 # define lchown rpl_lchown
960 #elif defined GNULIB_POSIXCHECK
962 # if HAVE_RAW_DECL_LCHOWN
963 _GL_WARN_ON_USE (lchown,
"lchown is unportable to pre-POSIX.1-2001 systems - "
964 "use gnulib module lchown for portability");
975 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
976 # define link rpl_link
989 #elif defined GNULIB_POSIXCHECK
991 # if HAVE_RAW_DECL_LINK
993 "use gnulib module link for portability");
1002 # if @REPLACE_LINKAT@
1003 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1005 # define linkat rpl_linkat
1008 (
int fd1,
const char *path1,
int fd2,
const char *path2,
1012 (
int fd1,
const char *path1,
int fd2,
const char *path2,
1017 (
int fd1,
const char *path1,
int fd2,
const char *path2,
1022 (
int fd1,
const char *path1,
int fd2,
const char *path2,
1026 #elif defined GNULIB_POSIXCHECK
1028 # if HAVE_RAW_DECL_LINKAT
1030 "use gnulib module linkat for portability");
1040 # if @REPLACE_LSEEK@
1041 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1042 # define lseek rpl_lseek
1050 #elif defined GNULIB_POSIXCHECK
1052 # if HAVE_RAW_DECL_LSEEK
1053 _GL_WARN_ON_USE (lseek,
"lseek does not fail with ESPIPE on pipes on some "
1054 "systems - use gnulib module lseek for portability");
1068 #elif defined GNULIB_POSIXCHECK
1070 # if HAVE_RAW_DECL_PIPE
1072 "use gnulib module pipe-posix for portability");
1087 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1088 # define pipe2 rpl_pipe2
1097 #elif defined GNULIB_POSIXCHECK
1099 # if HAVE_RAW_DECL_PIPE2
1101 "use gnulib module pipe2 for portability");
1112 # if @REPLACE_PREAD@
1113 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1115 # define pread rpl_pread
1118 (
int fd,
void *
buf,
size_t bufsize, off_t
offset)
1121 (
int fd,
void *
buf,
size_t bufsize, off_t
offset));
1125 (
int fd,
void *
buf,
size_t bufsize, off_t
offset)
1129 (
int fd,
void *
buf,
size_t bufsize, off_t
offset));
1132 #elif defined GNULIB_POSIXCHECK
1134 # if HAVE_RAW_DECL_PREAD
1136 "use gnulib module pread for portability");
1147 # if @REPLACE_PWRITE@
1148 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1150 # define pwrite rpl_pwrite
1153 (
int fd,
const void *
buf,
size_t bufsize, off_t
offset)
1156 (
int fd,
const void *
buf,
size_t bufsize, off_t
offset));
1160 (
int fd,
const void *
buf,
size_t bufsize, off_t
offset)
1164 (
int fd,
const void *
buf,
size_t bufsize, off_t
offset));
1167 #elif defined GNULIB_POSIXCHECK
1169 # if HAVE_RAW_DECL_PWRITE
1171 "use gnulib module pwrite for portability");
1181 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1183 # define read rpl_read
1198 #if @GNULIB_READLINK@
1204 # if @REPLACE_READLINK@
1205 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1206 # define readlink rpl_readlink
1209 (
const char *file,
char *
buf,
size_t bufsize)
1212 (
const char *file,
char *
buf,
size_t bufsize));
1214 # if !@HAVE_READLINK@
1216 (
const char *file,
char *
buf,
size_t bufsize)
1220 (
const char *file,
char *
buf,
size_t bufsize));
1223 #elif defined GNULIB_POSIXCHECK
1225 # if HAVE_RAW_DECL_READLINK
1227 "use gnulib module readlink for portability");
1232 #if @GNULIB_READLINKAT@
1233 # if !@HAVE_READLINKAT@
1235 (
int fd,
char const *file,
char *
buf,
size_t len)
1239 (
int fd,
char const *file,
char *
buf,
size_t len));
1241 #elif defined GNULIB_POSIXCHECK
1243 # if HAVE_RAW_DECL_READLINKAT
1245 "use gnulib module readlinkat for portability");
1252 # if @REPLACE_RMDIR@
1253 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1254 # define rmdir rpl_rmdir
1262 #elif defined GNULIB_POSIXCHECK
1264 # if HAVE_RAW_DECL_RMDIR
1266 "use gnulib module rmdir for portability");
1276 # if @REPLACE_SLEEP@
1277 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1279 # define sleep rpl_sleep
1290 #elif defined GNULIB_POSIXCHECK
1292 # if HAVE_RAW_DECL_SLEEP
1294 "use gnulib module sleep for portability");
1299 #if @GNULIB_SYMLINK@
1300 # if @REPLACE_SYMLINK@
1301 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1303 # define symlink rpl_symlink
1309 # if !@HAVE_SYMLINK@
1316 #elif defined GNULIB_POSIXCHECK
1318 # if HAVE_RAW_DECL_SYMLINK
1320 "use gnulib module symlink for portability");
1325 #if @GNULIB_SYMLINKAT@
1326 # if !@HAVE_SYMLINKAT@
1328 (
char const *contents,
int fd,
char const *file)
1332 (
char const *contents,
int fd,
char const *file));
1334 #elif defined GNULIB_POSIXCHECK
1336 # if HAVE_RAW_DECL_SYMLINKAT
1338 "use gnulib module symlinkat for portability");
1343 #if @GNULIB_TTYNAME_R@
1346 # if @REPLACE_TTYNAME_R@
1347 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1349 # define ttyname_r rpl_ttyname_r
1354 (
int fd,
char *
buf,
size_t buflen));
1356 # if !@HAVE_DECL_TTYNAME_R@
1361 (
int fd,
char *
buf,
size_t buflen));
1364 #elif defined GNULIB_POSIXCHECK
1366 # if HAVE_RAW_DECL_TTYNAME_R
1368 "use gnulib module ttyname_r for portability");
1374 # if @REPLACE_UNLINK@
1375 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1377 # define unlink rpl_unlink
1385 #elif defined GNULIB_POSIXCHECK
1387 # if HAVE_RAW_DECL_UNLINK
1389 "use gnulib module unlink for portability");
1394 #if @GNULIB_UNLINKAT@
1395 # if @REPLACE_UNLINKAT@
1396 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1398 # define unlinkat rpl_unlinkat
1404 # if !@HAVE_UNLINKAT@
1411 #elif defined GNULIB_POSIXCHECK
1413 # if HAVE_RAW_DECL_UNLINKAT
1415 "use gnulib module openat for portability");
1425 # if @REPLACE_USLEEP@
1426 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1428 # define usleep rpl_usleep
1439 #elif defined GNULIB_POSIXCHECK
1441 # if HAVE_RAW_DECL_USLEEP
1443 "use gnulib module usleep for portability");
1452 # if @REPLACE_WRITE@
1453 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1455 # define write rpl_write
#define _GL_ARG_NONNULL(params)
A C macro for declaring that specific arguments must not be NULL.
#define _GL_EXTERN_C
C++ compatible function declaration macros.
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
_GL_CXXALIAS_RPL (func, rettype, parameters); declares a C++ alias called GNULIB_NAMESPACE::func that...
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
_GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); declares a replacement function,...
#define _GL_CXXALIAS_SYS_CAST(func, rettype, parameters)
_GL_CXXALIAS_SYS_CAST (func, rettype, parameters); is like _GL_CXXALIAS_SYS (func,...
#define _GL_CXXALIASWARN(func)
_GL_CXXALIASWARN (func); causes a warning to be emitted when ::func is used but not when GNULIB_NAMES...
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
_GL_CXXALIAS_SYS (func, rettype, parameters); declares a C++ alias called GNULIB_NAMESPACE::func that...
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
_GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); declares the system function,...
#define _GL_WARN_ON_USE(function, message)
A C macro for emitting warnings if a function is used.