1 # unistd_h.m4 serial 83
2 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 dnl Written by Simon Josefsson, Bruno Haible.
9 AC_DEFUN([gl_UNISTD_H],
11 dnl Use AC_REQUIRE here, so that the default behavior below is expanded
12 dnl once only, before all statements that occur in other macros.
13 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
15 gl_CHECK_NEXT_HEADERS([unistd.h])
16 if test $ac_cv_header_unistd_h = yes; then
21 AC_SUBST([HAVE_UNISTD_H])
23 dnl Ensure the type pid_t gets defined.
24 AC_REQUIRE([AC_TYPE_PID_T])
26 dnl Determine WINDOWS_64_BIT_OFF_T.
27 AC_REQUIRE([gl_TYPE_OFF_T])
29 dnl Check for declarations of anything we want to poison if the
30 dnl corresponding gnulib module is not in use.
31 gl_WARN_ON_USE_PREPARE([[
35 /* Some systems declare various items in the wrong headers. */
36 #if !(defined __GLIBC__ && !defined __UCLIBC__)
40 # if defined _WIN32 && ! defined __CYGWIN__
44 ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess
46 fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
47 getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
48 getusershell setusershell endusershell
49 group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
50 readlink readlinkat rmdir sethostname sleep symlink symlinkat
51 truncate ttyname_r unlink unlinkat usleep])
53 AC_REQUIRE([AC_C_RESTRICT])
55 AC_CHECK_DECLS_ONCE([execvpe])
56 if test $ac_cv_have_decl_execvpe = no; then
61 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
63 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
64 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
65 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
66 dnl Define it also as a C macro, for the benefit of the unit tests.
67 gl_MODULE_INDICATOR_FOR_TESTS([$1])
70 AC_DEFUN([gl_UNISTD_H_DEFAULTS],
72 GNULIB_ACCESS=0; AC_SUBST([GNULIB_ACCESS])
73 GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR])
74 GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN])
75 GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE])
76 GNULIB_COPY_FILE_RANGE=0; AC_SUBST([GNULIB_COPY_FILE_RANGE])
77 GNULIB_DUP=0; AC_SUBST([GNULIB_DUP])
78 GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2])
79 GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3])
80 GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON])
81 GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS])
82 GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT])
83 GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR])
84 GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT])
85 GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC])
86 GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC])
87 GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE])
88 GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
89 GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME])
90 GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE])
91 GNULIB_GETENTROPY=0; AC_SUBST([GNULIB_GETENTROPY])
92 GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS])
93 GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME])
94 GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN])
95 GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
96 GNULIB_GETOPT_POSIX=0; AC_SUBST([GNULIB_GETOPT_POSIX])
97 GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
98 GNULIB_GETPASS=0; AC_SUBST([GNULIB_GETPASS])
99 GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL])
100 GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER])
101 GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY])
102 GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
103 GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
104 GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
105 GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
106 GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE])
107 GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
108 GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
109 GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
110 GNULIB_READ=0; AC_SUBST([GNULIB_READ])
111 GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
112 GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT])
113 GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR])
114 GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME])
115 GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
116 GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK])
117 GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT])
118 GNULIB_TRUNCATE=0; AC_SUBST([GNULIB_TRUNCATE])
119 GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R])
120 GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING])
121 GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
122 GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK])
123 GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT])
124 GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP])
125 GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE])
126 dnl Assume proper GNU behavior unless another module says otherwise.
127 HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN])
128 HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE])
129 HAVE_DUP3=1; AC_SUBST([HAVE_DUP3])
130 HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS])
131 HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT])
132 HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR])
133 HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT])
134 HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC])
135 HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC])
136 HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
137 HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE])
138 HAVE_GETENTROPY=1; AC_SUBST([HAVE_GETENTROPY])
139 HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS])
140 HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
141 HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN])
142 HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
143 HAVE_GETPASS=1; AC_SUBST([HAVE_GETPASS])
144 HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER])
145 HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN])
146 HAVE_LINK=1; AC_SUBST([HAVE_LINK])
147 HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
148 HAVE_PIPE=1; AC_SUBST([HAVE_PIPE])
149 HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2])
150 HAVE_PREAD=1; AC_SUBST([HAVE_PREAD])
151 HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE])
152 HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
153 HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT])
154 HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME])
155 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
156 HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
157 HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
158 HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT])
159 HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
160 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
161 HAVE_DECL_EXECVPE=1; AC_SUBST([HAVE_DECL_EXECVPE])
162 HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR])
163 HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC])
164 HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
165 HAVE_DECL_GETLOGIN=1; AC_SUBST([HAVE_DECL_GETLOGIN])
166 HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
167 HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
168 HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
169 HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME])
170 HAVE_DECL_TRUNCATE=1; AC_SUBST([HAVE_DECL_TRUNCATE])
171 HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R])
172 HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
173 HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
174 REPLACE_ACCESS=0; AC_SUBST([REPLACE_ACCESS])
175 REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
176 REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE])
177 REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
178 REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
179 REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT])
180 REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
181 REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE])
182 REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
183 REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
184 REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE])
185 REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
186 REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
187 REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
188 REPLACE_GETPASS=0; AC_SUBST([REPLACE_GETPASS])
189 REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY])
190 REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
191 REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
192 REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT])
193 REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
194 REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD])
195 REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
196 REPLACE_READ=0; AC_SUBST([REPLACE_READ])
197 REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
198 REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT])
199 REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
200 REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
201 REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK])
202 REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT])
203 REPLACE_TRUNCATE=0; AC_SUBST([REPLACE_TRUNCATE])
204 REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R])
205 REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK])
206 REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])
207 REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP])
208 REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE])
209 UNISTD_H_HAVE_SYS_RANDOM_H=0; AC_SUBST([UNISTD_H_HAVE_SYS_RANDOM_H])
210 UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
211 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
212 AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])