summaryrefslogtreecommitdiffstats
path: root/gl/m4/unistd_h.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/unistd_h.m4')
-rw-r--r--gl/m4/unistd_h.m4137
1 files changed, 82 insertions, 55 deletions
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index 48d06c7..32dcfa5 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
1# unistd_h.m4 serial 46 1# unistd_h.m4 serial 66
2dnl Copyright (C) 2006-2010 Free Software Foundation, Inc. 2dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -11,11 +11,8 @@ AC_DEFUN([gl_UNISTD_H],
11 dnl Use AC_REQUIRE here, so that the default behavior below is expanded 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. 12 dnl once only, before all statements that occur in other macros.
13 AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) 13 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
14 AC_REQUIRE([AC_C_INLINE])
15 14
16 gl_CHECK_NEXT_HEADERS([unistd.h]) 15 gl_CHECK_NEXT_HEADERS([unistd.h])
17
18 AC_CHECK_HEADERS_ONCE([unistd.h])
19 if test $ac_cv_header_unistd_h = yes; then 16 if test $ac_cv_header_unistd_h = yes; then
20 HAVE_UNISTD_H=1 17 HAVE_UNISTD_H=1
21 else 18 else
@@ -23,11 +20,20 @@ AC_DEFUN([gl_UNISTD_H],
23 fi 20 fi
24 AC_SUBST([HAVE_UNISTD_H]) 21 AC_SUBST([HAVE_UNISTD_H])
25 22
23 dnl Ensure the type pid_t gets defined.
24 AC_REQUIRE([AC_TYPE_PID_T])
25
26 dnl Determine WINDOWS_64_BIT_OFF_T.
27 AC_REQUIRE([gl_TYPE_OFF_T])
28
26 dnl Check for declarations of anything we want to poison if the 29 dnl Check for declarations of anything we want to poison if the
27 dnl corresponding gnulib module is not in use. 30 dnl corresponding gnulib module is not in use.
28 gl_WARN_ON_USE_PREPARE([[#include <unistd.h> 31 gl_WARN_ON_USE_PREPARE([[
32#if HAVE_UNISTD_H
33# include <unistd.h>
34#endif
29/* Some systems declare various items in the wrong headers. */ 35/* Some systems declare various items in the wrong headers. */
30#ifndef __GLIBC__ 36#if !(defined __GLIBC__ && !defined __UCLIBC__)
31# include <fcntl.h> 37# include <fcntl.h>
32# include <stdio.h> 38# include <stdio.h>
33# include <stdlib.h> 39# include <stdlib.h>
@@ -35,12 +41,13 @@ AC_DEFUN([gl_UNISTD_H],
35# include <io.h> 41# include <io.h>
36# endif 42# endif
37#endif 43#endif
38 ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat 44 ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
39 fsync ftruncate getcwd getdomainname getdtablesize getgroups 45 fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
40 gethostname getlogin getlogin_r getpagesize getusershell setusershell 46 gethostname getlogin getlogin_r getpagesize
41 endusershell lchown link linkat lseek pipe2 pread pwrite readlink 47 getusershell setusershell endusershell
42 readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat 48 group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
43 usleep]) 49 readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r
50 unlink unlinkat usleep])
44]) 51])
45 52
46AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], 53AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -54,46 +61,54 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
54 61
55AC_DEFUN([gl_UNISTD_H_DEFAULTS], 62AC_DEFUN([gl_UNISTD_H_DEFAULTS],
56[ 63[
57 GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) 64 GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR])
58 GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) 65 GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN])
59 GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) 66 GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE])
60 GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) 67 GNULIB_DUP=0; AC_SUBST([GNULIB_DUP])
61 GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) 68 GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2])
62 GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) 69 GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3])
63 GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) 70 GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON])
64 GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) 71 GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS])
65 GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) 72 GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT])
66 GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) 73 GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR])
67 GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) 74 GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT])
68 GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) 75 GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC])
69 GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) 76 GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC])
70 GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) 77 GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE])
71 GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) 78 GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
72 GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) 79 GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME])
73 GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) 80 GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE])
74 GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) 81 GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS])
75 GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) 82 GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME])
76 GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) 83 GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN])
77 GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) 84 GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
78 GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) 85 GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
79 GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) 86 GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL])
80 GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) 87 GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER])
81 GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) 88 GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY])
82 GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) 89 GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
83 GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE]) 90 GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
84 GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) 91 GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
85 GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) 92 GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
86 GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) 93 GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE])
87 GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) 94 GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
88 GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) 95 GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
89 GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) 96 GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
90 GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) 97 GNULIB_READ=0; AC_SUBST([GNULIB_READ])
91 GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT]) 98 GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
92 GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) 99 GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT])
93 GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) 100 GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR])
94 GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) 101 GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME])
95 GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) 102 GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
96 GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) 103 GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK])
104 GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT])
105 GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R])
106 GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING])
107 GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
108 GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK])
109 GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT])
110 GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP])
111 GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE])
97 dnl Assume proper GNU behavior unless another module says otherwise. 112 dnl Assume proper GNU behavior unless another module says otherwise.
98 HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) 113 HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN])
99 HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) 114 HAVE_DUP2=1; AC_SUBST([HAVE_DUP2])
@@ -102,32 +117,39 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
102 HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) 117 HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT])
103 HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) 118 HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR])
104 HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) 119 HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT])
120 HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC])
105 HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) 121 HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC])
106 HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) 122 HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
107 HAVE_GETDOMAINNAME=1; AC_SUBST([HAVE_GETDOMAINNAME])
108 HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) 123 HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE])
109 HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS]) 124 HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS])
110 HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) 125 HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
111 HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) 126 HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN])
112 HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) 127 HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
128 HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER])
113 HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) 129 HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN])
114 HAVE_LINK=1; AC_SUBST([HAVE_LINK]) 130 HAVE_LINK=1; AC_SUBST([HAVE_LINK])
115 HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT]) 131 HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
132 HAVE_PIPE=1; AC_SUBST([HAVE_PIPE])
116 HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2]) 133 HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2])
117 HAVE_PREAD=1; AC_SUBST([HAVE_PREAD]) 134 HAVE_PREAD=1; AC_SUBST([HAVE_PREAD])
118 HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE]) 135 HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE])
119 HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) 136 HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
120 HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT]) 137 HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT])
138 HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME])
121 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) 139 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
122 HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) 140 HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
123 HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) 141 HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
124 HAVE_TTYNAME_R=1; AC_SUBST([HAVE_TTYNAME_R])
125 HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) 142 HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT])
126 HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) 143 HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
127 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) 144 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
145 HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR])
146 HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC])
147 HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
128 HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) 148 HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
129 HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) 149 HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
130 HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) 150 HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
151 HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME])
152 HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R])
131 HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) 153 HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
132 HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) 154 HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
133 REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) 155 REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
@@ -135,15 +157,20 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
135 REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) 157 REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
136 REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) 158 REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
137 REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) 159 REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
160 REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE])
138 REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) 161 REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
162 REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
163 REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
139 REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) 164 REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
140 REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) 165 REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
166 REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY])
141 REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) 167 REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
142 REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) 168 REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
143 REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT]) 169 REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT])
144 REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) 170 REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
145 REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) 171 REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD])
146 REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) 172 REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
173 REPLACE_READ=0; AC_SUBST([REPLACE_READ])
147 REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) 174 REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
148 REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) 175 REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
149 REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) 176 REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])