… | |
… | |
12 | # for these to work, you need to run autoheader in IO::AIO, not libeio :( |
12 | # for these to work, you need to run autoheader in IO::AIO, not libeio :( |
13 | |
13 | |
14 | AC_CACHE_CHECK(for set/getrlimit, ac_cv_rlimits, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
14 | AC_CACHE_CHECK(for set/getrlimit, ac_cv_rlimits, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
15 | #include <sys/time.h> |
15 | #include <sys/time.h> |
16 | #include <sys/resource.h> |
16 | #include <sys/resource.h> |
17 | int res; |
|
|
18 | int main (void) |
17 | int main (void) |
19 | { |
18 | { |
20 | struct rlimit srl; |
19 | struct rlimit srl; |
|
|
20 | int res; |
21 | srl.rlim_cur = srl.rlim_max = RLIM_INFINITY; |
21 | srl.rlim_cur = srl.rlim_max = RLIM_INFINITY; |
22 | res = getrlimit (RLIMIT_NOFILE, &srl); |
22 | res = getrlimit (RLIMIT_NOFILE, &srl); |
23 | res = setrlimit (RLIMIT_NOFILE, &srl); |
23 | res = setrlimit (RLIMIT_NOFILE, &srl); |
24 | return 0; |
24 | return 0; |
25 | } |
25 | } |
… | |
… | |
62 | AC_CHECK_HEADERS([linux/fs.h linux/fiemap.h]) |
62 | AC_CHECK_HEADERS([linux/fs.h linux/fiemap.h]) |
63 | |
63 | |
64 | dnl glibc major/minor macros |
64 | dnl glibc major/minor macros |
65 | AC_CHECK_HEADERS([sys/sysmacros.h]) |
65 | AC_CHECK_HEADERS([sys/sysmacros.h]) |
66 | |
66 | |
|
|
67 | dnl solaris major/minor |
|
|
68 | AC_CHECK_HEADERS([sys/mkdev.h]) |
|
|
69 | |
|
|
70 | dnl readv / preadv, vmsplice |
|
|
71 | AC_CHECK_HEADERS([sys/uio.h]) |
|
|
72 | |
|
|
73 | dnl fexecve has always been in the single unix specification |
|
|
74 | dnl but some atrocities (like opsnbsd and osx) claim implementing it |
|
|
75 | dnl but then not definining it. ugh. garbage. and fexecve would be |
|
|
76 | dnl useful for security, but, no, not on openbsd. we'd rather lie |
|
|
77 | dnl about it. |
|
|
78 | AC_CACHE_CHECK(for fexecve, ac_cv_fexecve, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
79 | #include <fcntl.h> |
|
|
80 | #include <unistd.h> |
|
|
81 | int main (void) |
|
|
82 | { |
|
|
83 | int res = fexecve (-1, "argv", 0); |
|
|
84 | return 0; |
|
|
85 | } |
|
|
86 | ]])],ac_cv_fexecve=yes,ac_cv_fexecve=no)]) |
|
|
87 | test $ac_cv_fexecve = yes && AC_DEFINE(HAVE_FEXECVE, 1, fexecve(2) is available) |
|
|
88 | |
|
|
89 | AC_CACHE_CHECK([for siginfo_t], ac_cv_siginfo_t, [AC_LINK_IFELSE([AC_LANG_SOURCE([ |
|
|
90 | #include <signal.h> |
|
|
91 | int main (void) |
|
|
92 | { |
|
|
93 | siginfo_t si; |
|
|
94 | si.si_code; |
|
|
95 | si.si_pid; |
|
|
96 | si.si_uid; |
|
|
97 | si.si_value.sival_int; |
|
|
98 | si.si_value.sival_ptr; |
|
|
99 | return 0; |
|
|
100 | } |
|
|
101 | ])],ac_cv_siginfo_t=yes,ac_cv_siginfo_t=no)]) |
|
|
102 | test $ac_cv_siginfo_t = yes && AC_DEFINE(HAVE_SIGINFO_T, 1, have siginfo_t in signal.h) |
|
|
103 | |
|
|
104 | AC_CACHE_CHECK([for unix-style syscall interface], ac_cv_syscall, [AC_LINK_IFELSE([AC_LANG_SOURCE([ |
|
|
105 | #include <unistd.h> |
|
|
106 | #include <sys/syscall.h> |
|
|
107 | int main (void) |
|
|
108 | { |
|
|
109 | long res = syscall (SYS_exit, 0); |
|
|
110 | return 0; |
|
|
111 | } |
|
|
112 | ])],ac_cv_syscall=yes,ac_cv_syscall=no)]) |
|
|
113 | test $ac_cv_syscall = yes && AC_DEFINE(HAVE_SYSCALL, 1, unix syscall interface) |
|
|
114 | |
67 | AC_CACHE_CHECK([for splice, vmsplice and tee], ac_cv_linux_splice, [AC_LINK_IFELSE([AC_LANG_SOURCE([ |
115 | AC_CACHE_CHECK([for splice, vmsplice and tee], ac_cv_linux_splice, [AC_LINK_IFELSE([AC_LANG_SOURCE([ |
|
|
116 | #include <sys/types.h> |
68 | #include <fcntl.h> |
117 | #include <fcntl.h> |
|
|
118 | #include <sys/uio.h> |
69 | int main (void) |
119 | int main (void) |
70 | { |
120 | { |
71 | ssize_t res; |
121 | ssize_t res; |
72 | res = splice ((int)0, (loff_t)0, (int)0, (loff_t *)0, (size_t)0, SPLICE_F_MOVE | SPLICE_F_NONBLOCK | SPLICE_F_MORE); |
122 | res = splice ((int)0, (loff_t)0, (int)0, (loff_t *)0, (size_t)0, SPLICE_F_MOVE | SPLICE_F_NONBLOCK | SPLICE_F_MORE); |
73 | res = tee ((int)0, (int)0, (size_t)0, SPLICE_F_NONBLOCK); |
123 | res = tee ((int)0, (int)0, (size_t)0, SPLICE_F_NONBLOCK); |
… | |
… | |
78 | test $ac_cv_linux_splice = yes && AC_DEFINE(HAVE_LINUX_SPLICE, 1, splice/vmsplice/tee(2) are available) |
128 | test $ac_cv_linux_splice = yes && AC_DEFINE(HAVE_LINUX_SPLICE, 1, splice/vmsplice/tee(2) are available) |
79 | |
129 | |
80 | AC_CACHE_CHECK(for pipe2, ac_cv_pipe2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
130 | AC_CACHE_CHECK(for pipe2, ac_cv_pipe2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
81 | #include <fcntl.h> |
131 | #include <fcntl.h> |
82 | #include <unistd.h> |
132 | #include <unistd.h> |
|
|
133 | int main (void) |
|
|
134 | { |
83 | int res; |
135 | int res; |
84 | int main (void) |
|
|
85 | { |
|
|
86 | res = pipe2 (0, 0); |
136 | res = pipe2 (0, 0); |
87 | return 0; |
137 | return 0; |
88 | } |
138 | } |
89 | ]])],ac_cv_pipe2=yes,ac_cv_pipe2=no)]) |
139 | ]])],ac_cv_pipe2=yes,ac_cv_pipe2=no)]) |
90 | test $ac_cv_pipe2 = yes && AC_DEFINE(HAVE_PIPE2, 1, pipe2(2) is available) |
140 | test $ac_cv_pipe2 = yes && AC_DEFINE(HAVE_PIPE2, 1, pipe2(2) is available) |
91 | |
141 | |
92 | AC_CACHE_CHECK(for eventfd, ac_cv_eventfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
142 | AC_CACHE_CHECK(for eventfd, ac_cv_eventfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
93 | #include <sys/eventfd.h> |
143 | #include <sys/eventfd.h> |
|
|
144 | int main (void) |
|
|
145 | { |
94 | int res; |
146 | int res; |
95 | int main (void) |
|
|
96 | { |
|
|
97 | res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK); |
147 | res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK); |
98 | return 0; |
148 | return 0; |
99 | } |
149 | } |
100 | ]])],ac_cv_eventfd=yes,ac_cv_eventfd=no)]) |
150 | ]])],ac_cv_eventfd=yes,ac_cv_eventfd=no)]) |
101 | test $ac_cv_eventfd = yes && AC_DEFINE(HAVE_EVENTFD, 1, eventfd(2) is available) |
151 | test $ac_cv_eventfd = yes && AC_DEFINE(HAVE_EVENTFD, 1, eventfd(2) is available) |
102 | |
152 | |
103 | AC_CACHE_CHECK(for timerfd, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
153 | AC_CACHE_CHECK(for timerfd_*, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
104 | #include <sys/timerfd.h> |
154 | #include <sys/timerfd.h> |
105 | int res; |
|
|
106 | int main (void) |
155 | int main (void) |
107 | { |
156 | { |
108 | struct itimerspec its; |
157 | struct itimerspec its; |
|
|
158 | int res; |
109 | res = timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK); |
159 | res = timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK); |
110 | res = timerfd_settime (res, TFD_TIMER_ABSTIME /*| TFD_TIMER_CANCEL_ON_SET*/, &its, 0); |
160 | res = timerfd_settime (res, TFD_TIMER_ABSTIME /*| TFD_TIMER_CANCEL_ON_SET*/, &its, 0); |
111 | res = timerfd_gettime (res, &its); |
161 | res = timerfd_gettime (res, &its); |
112 | return 0; |
162 | return 0; |
113 | } |
163 | } |
114 | ]])],ac_cv_timerfd=yes,ac_cv_timerfd=no)]) |
164 | ]])],ac_cv_timerfd=yes,ac_cv_timerfd=no)]) |
115 | test $ac_cv_timerfd = yes && AC_DEFINE(HAVE_TIMERFD, 1, timerfd_*(2) are available) |
165 | test $ac_cv_timerfd = yes && AC_DEFINE(HAVE_TIMERFD, 1, timerfd_*(2) are available) |
116 | |
166 | |
|
|
167 | AC_CACHE_CHECK(for memfd_create, ac_cv_memfd_create, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
168 | #include <sys/mman.h> |
|
|
169 | int main (void) |
|
|
170 | { |
|
|
171 | int res = memfd_create ("name", MFD_CLOEXEC | MFD_ALLOW_SEALING); |
|
|
172 | return 0; |
|
|
173 | } |
|
|
174 | ]])],ac_cv_memfd_create=yes,ac_cv_memfd_create=no)]) |
|
|
175 | test $ac_cv_memfd_create = yes && AC_DEFINE(HAVE_MEMFD_CREATE, 1, memfd_create(2) is available) |
|
|
176 | |
117 | AC_CACHE_CHECK(for copy_file_range, ac_cv_copy_file_range, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
177 | AC_CACHE_CHECK(for copy_file_range, ac_cv_copy_file_range, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
118 | #include <unistd.h> |
178 | #include <unistd.h> |
119 | #include <sys/syscall.h> |
179 | #include <sys/syscall.h> |
120 | /*#include <linux/copy.h>*/ |
180 | /*#include <linux/copy.h>*/ |
|
|
181 | int main (void) |
|
|
182 | { |
121 | int res; |
183 | int res; |
122 | int main (void) |
|
|
123 | { |
|
|
124 | /*res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, COPY_FR_REFLINK | COPY_FR_DEDUP | COPY_FR_COPY);*/ |
184 | /*res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, COPY_FR_REFLINK | COPY_FR_DEDUP | COPY_FR_COPY);*/ |
125 | res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, 0); |
185 | res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, 0); |
126 | return 0; |
186 | return 0; |
127 | } |
187 | } |
128 | ]])],ac_cv_copy_file_range=yes,ac_cv_copy_file_range=no)]) |
188 | ]])],ac_cv_copy_file_range=yes,ac_cv_copy_file_range=no)]) |
… | |
… | |
131 | AC_CACHE_CHECK(for st_xtimensec, ac_cv_xtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
191 | AC_CACHE_CHECK(for st_xtimensec, ac_cv_xtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
132 | #include "EXTERN.h" |
192 | #include "EXTERN.h" |
133 | #include "perl.h" |
193 | #include "perl.h" |
134 | #include "XSUB.h" |
194 | #include "XSUB.h" |
135 | |
195 | |
136 | int res; |
|
|
137 | int main (void) |
196 | int main (void) |
138 | { |
197 | { |
139 | return PL_statcache.st_atimensec |
198 | return PL_statcache.st_atimensec |
140 | + PL_statcache.st_mtimensec |
199 | + PL_statcache.st_mtimensec |
141 | + PL_statcache.st_ctimensec; |
200 | + PL_statcache.st_ctimensec; |
142 | return 0; |
|
|
143 | } |
201 | } |
144 | ]])],ac_cv_xtimensec=yes,ac_cv_xtimensec=no)]) |
202 | ]])],ac_cv_xtimensec=yes,ac_cv_xtimensec=no)]) |
145 | test $ac_cv_xtimensec = yes && AC_DEFINE(HAVE_ST_XTIMENSEC, 1, stat nanosecond access by st_xtimensec) |
203 | test $ac_cv_xtimensec = yes && AC_DEFINE(HAVE_ST_XTIMENSEC, 1, stat nanosecond access by st_xtimensec) |
146 | |
204 | |
147 | AC_CACHE_CHECK(for st_xtimespec, ac_cv_xtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
205 | AC_CACHE_CHECK(for st_xtimespec, ac_cv_xtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
148 | #include "EXTERN.h" |
206 | #include "EXTERN.h" |
149 | #include "perl.h" |
207 | #include "perl.h" |
150 | #include "XSUB.h" |
208 | #include "XSUB.h" |
151 | |
209 | |
152 | int res; |
|
|
153 | int main (void) |
210 | int main (void) |
154 | { |
211 | { |
155 | return PL_statcache.st_atim.tv_nsec |
212 | return PL_statcache.st_atim.tv_nsec |
156 | + PL_statcache.st_mtim.tv_nsec |
213 | + PL_statcache.st_mtim.tv_nsec |
157 | + PL_statcache.st_ctim.tv_nsec; |
214 | + PL_statcache.st_ctim.tv_nsec; |
… | |
… | |
159 | ]])],ac_cv_xtimespec=yes,ac_cv_xtimespec=no)]) |
216 | ]])],ac_cv_xtimespec=yes,ac_cv_xtimespec=no)]) |
160 | test $ac_cv_xtimespec = yes && AC_DEFINE(HAVE_ST_XTIMESPEC, 1, stat nanosecond access by st_xtimespec) |
217 | test $ac_cv_xtimespec = yes && AC_DEFINE(HAVE_ST_XTIMESPEC, 1, stat nanosecond access by st_xtimespec) |
161 | |
218 | |
162 | # apparently, True64 uses st_u[amc]time, aix uses at_[amc]time_n and apple uses st_[amc,birth]timespec? |
219 | # apparently, True64 uses st_u[amc]time, aix uses at_[amc]time_n and apple uses st_[amc,birth]timespec? |
163 | |
220 | |
|
|
221 | AC_CACHE_CHECK(for st_birthtimensec, ac_cv_birthtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
|
|
222 | #include "EXTERN.h" |
|
|
223 | #include "perl.h" |
|
|
224 | #include "XSUB.h" |
|
|
225 | |
|
|
226 | int main (void) |
|
|
227 | { |
|
|
228 | return PL_statcache.st_birthtime + PL_statcache.st_birthtimensec; |
|
|
229 | } |
|
|
230 | ]])],ac_cv_birthtimensec=yes,ac_cv_birthtimensec=no)]) |
|
|
231 | test $ac_cv_birthtimensec = yes && AC_DEFINE(HAVE_ST_BIRTHTIMENSEC, 1, birthtime nanosecond access by st_birthtimensec) |
|
|
232 | |
|
|
233 | AC_CACHE_CHECK(for st_birthtimespec, ac_cv_birthtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
|
|
234 | #include "EXTERN.h" |
|
|
235 | #include "perl.h" |
|
|
236 | #include "XSUB.h" |
|
|
237 | |
|
|
238 | int main (void) |
|
|
239 | { |
|
|
240 | return PL_statcache.st_birthtim.tv_sec + PL_statcache.st_birthtim.tv_nsec; |
|
|
241 | } |
|
|
242 | ]])],ac_cv_birthtimespec=yes,ac_cv_birthtimespec=no)]) |
|
|
243 | test $ac_cv_birthtimespec = yes && AC_DEFINE(HAVE_ST_BIRTHTIMESPEC, 1, birthtime nanosecond access by st_birthtimespec) |
|
|
244 | |
|
|
245 | AC_CACHE_CHECK(for st_gen, ac_cv_st_gen, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
|
|
246 | #include "EXTERN.h" |
|
|
247 | #include "perl.h" |
|
|
248 | #include "XSUB.h" |
|
|
249 | |
|
|
250 | int main (void) |
|
|
251 | { |
|
|
252 | return PL_statcache.st_gen; |
|
|
253 | } |
|
|
254 | ]])],ac_cv_st_gen=yes,ac_cv_st_gen=no)]) |
|
|
255 | test $ac_cv_st_gen = yes && AC_DEFINE(HAVE_ST_GEN, 1, stat st_gen member) |
|
|
256 | |
|
|
257 | AC_CACHE_CHECK(for statx, ac_cv_statx, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
258 | #include <sys/types.h> |
|
|
259 | #include <sys/stat.h> |
|
|
260 | #include <unistd.h> |
|
|
261 | #include <fcntl.h> |
|
|
262 | int res; |
|
|
263 | int main (void) |
|
|
264 | { |
|
|
265 | struct statx sx; |
|
|
266 | int res; |
|
|
267 | res = statx (AT_FDCWD, ".", |
|
|
268 | AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | AT_STATX_SYNC_AS_STAT | AT_STATX_FORCE_SYNC | AT_STATX_DONT_SYNC, |
|
|
269 | STATX_ALL, &sx); |
|
|
270 | STATX_TYPE; STATX_MODE; STATX_NLINK; STATX_UID; STATX_GID; STATX_ATIME; STATX_MTIME; STATX_CTIME; |
|
|
271 | STATX_INO; STATX_SIZE; STATX_BLOCKS; STATX_BASIC_STATS; STATX_BTIME; STATX_ALL; |
|
|
272 | STATX_ATTR_COMPRESSED; STATX_ATTR_IMMUTABLE; STATX_ATTR_APPEND; STATX_ATTR_NODUMP; STATX_ATTR_ENCRYPTED; |
|
|
273 | return 0; |
|
|
274 | } |
|
|
275 | ]])],ac_cv_statx=yes,ac_cv_statx=no)]) |
|
|
276 | test $ac_cv_statx = yes && AC_DEFINE(HAVE_STATX, 1, statx(2) is available) |
|
|
277 | |
|
|
278 | AC_CACHE_CHECK(for accept4, ac_cv_accept4, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
279 | #include <sys/types.h> |
|
|
280 | #include <sys/socket.h> |
|
|
281 | int main (void) |
|
|
282 | { |
|
|
283 | int res = accept4 (1, (struct sockaddr *)0, (socklen_t)0, SOCK_NONBLOCK | SOCK_CLOEXEC); |
|
|
284 | return 0; |
|
|
285 | } |
|
|
286 | ]])],ac_cv_accept4=yes,ac_cv_accept4=no)]) |
|
|
287 | test $ac_cv_accept4 = yes && AC_DEFINE(HAVE_ACCEPT4, 1, accept4(2) is available) |
|
|
288 | |
|
|
289 | AC_CHECK_HEADERS([sys/mount.h]) |
|
|
290 | AC_CACHE_CHECK(for mount, ac_cv_mount, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
291 | #include <sys/mount.h> |
|
|
292 | int main (void) |
|
|
293 | { |
|
|
294 | int res = mount ("path", "path", "fstype", MS_RDONLY, 0); |
|
|
295 | return 0; |
|
|
296 | } |
|
|
297 | ]])],ac_cv_mount=yes,ac_cv_mount=no)]) |
|
|
298 | test $ac_cv_mount = yes && AC_DEFINE(HAVE_MOUNT, 1, mount is available) |
|
|
299 | AC_CACHE_CHECK(for umount, ac_cv_umount, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
300 | #include <sys/mount.h> |
|
|
301 | int main (void) |
|
|
302 | { |
|
|
303 | int res = umount ("path"); |
|
|
304 | return 0; |
|
|
305 | } |
|
|
306 | ]])],ac_cv_umount=yes,ac_cv_umount=no)]) |
|
|
307 | test $ac_cv_umount = yes && AC_DEFINE(HAVE_UMOUNT, 1, umount is available) |
|
|
308 | AC_CACHE_CHECK(for umount2, ac_cv_umount2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
309 | #include <sys/mount.h> |
|
|
310 | int main (void) |
|
|
311 | { |
|
|
312 | int res = umount2 ("path", MNT_FORCE|MNT_DETACH); |
|
|
313 | return 0; |
|
|
314 | } |
|
|
315 | ]])],ac_cv_umount2=yes,ac_cv_umount2=no)]) |
|
|
316 | test $ac_cv_umount2 = yes && AC_DEFINE(HAVE_UMOUNT2, 1, umount2 is available) |
|
|
317 | |
164 | AC_OUTPUT |
318 | AC_OUTPUT |
165 | |
319 | |