1 # unistd_h.m4 serial 61
2 dnl Copyright (C) 2006-2011 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])
14 AC_REQUIRE([AC_C_INLINE])
16 gl_CHECK_NEXT_HEADERS([unistd.h])
17 if test $ac_cv_header_unistd_h = yes; then
22 AC_SUBST([HAVE_UNISTD_H])
24 dnl Ensure the type pid_t gets defined.
25 AC_REQUIRE([AC_TYPE_PID_T])
27 dnl Check for declarations of anything we want to poison if the
28 dnl corresponding gnulib module is not in use.
29 gl_WARN_ON_USE_PREPARE([[
33 /* Some systems declare various items in the wrong headers. */
34 #if !(defined __GLIBC__ && !defined __UCLIBC__)
38 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
42 ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
43 fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
44 gethostname getlogin getlogin_r getpagesize getusershell setusershell
45 endusershell group_member lchown link linkat lseek pipe pipe2 pread pwrite
46 readlink readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
50 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
52 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
53 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
54 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
55 dnl Define it also as a C macro, for the benefit of the unit tests.
56 gl_MODULE_INDICATOR_FOR_TESTS([$1])
59 AC_DEFUN([gl_UNISTD_H_DEFAULTS],
61 GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR])
62 GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN])
63 GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE])
64 GNULIB_DUP=0; AC_SUBST([GNULIB_DUP])
65 GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2])
66 GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3])
67 GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON])
68 GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS])
69 GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT])
70 GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR])
71 GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT])
72 GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC])
73 GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC])
74 GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE])
75 GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
76 GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME])
77 GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE])
78 GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS])
79 GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME])
80 GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN])
81 GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
82 GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
83 GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL])
84 GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER])
85 GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
86 GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
87 GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
88 GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
89 GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE])
90 GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
91 GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
92 GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
93 GNULIB_READ=0; AC_SUBST([GNULIB_READ])
94 GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
95 GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT])
96 GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR])
97 GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
98 GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK])
99 GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT])
100 GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R])
101 GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT])
102 GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING])
103 GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
104 GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK])
105 GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT])
106 GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP])
107 GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE])
108 dnl Assume proper GNU behavior unless another module says otherwise.
109 HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN])
110 HAVE_DUP2=1; AC_SUBST([HAVE_DUP2])
111 HAVE_DUP3=1; AC_SUBST([HAVE_DUP3])
112 HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS])
113 HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT])
114 HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR])
115 HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT])
116 HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC])
117 HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC])
118 HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
119 HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE])
120 HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS])
121 HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
122 HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN])
123 HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
124 HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER])
125 HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN])
126 HAVE_LINK=1; AC_SUBST([HAVE_LINK])
127 HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
128 HAVE_PIPE=1; AC_SUBST([HAVE_PIPE])
129 HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2])
130 HAVE_PREAD=1; AC_SUBST([HAVE_PREAD])
131 HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE])
132 HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
133 HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT])
134 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
135 HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
136 HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
137 HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT])
138 HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
139 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
140 HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR])
141 HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC])
142 HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
143 HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
144 HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
145 HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
146 HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R])
147 HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
148 HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
149 REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
150 REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE])
151 REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
152 REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
153 REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
154 REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
155 REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
156 REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
157 REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
158 REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
159 REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
160 REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
161 REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT])
162 REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
163 REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD])
164 REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
165 REPLACE_READ=0; AC_SUBST([REPLACE_READ])
166 REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
167 REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
168 REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
169 REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK])
170 REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R])
171 REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK])
172 REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])
173 REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP])
174 REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE])
175 UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
176 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
177 AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])