… | |
… | |
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 | } |
… | |
… | |
59 | test $ac_cv_posix_fadvise = yes && AC_DEFINE(HAVE_POSIX_FADVISE, 1, posix_fadvise(2) is available) |
59 | test $ac_cv_posix_fadvise = yes && AC_DEFINE(HAVE_POSIX_FADVISE, 1, posix_fadvise(2) is available) |
60 | |
60 | |
61 | dnl lots of linux specifics |
61 | dnl lots of linux specifics |
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 |
|
|
65 | AC_CHECK_HEADERS([sys/sysmacros.h]) |
|
|
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 | AC_CACHE_CHECK([for siginfo_t], ac_cv_siginfo_t, [AC_LINK_IFELSE([AC_LANG_SOURCE([ |
|
|
74 | #include <signal.h> |
|
|
75 | int main (void) |
|
|
76 | { |
|
|
77 | siginfo_t si; |
|
|
78 | si.si_code; |
|
|
79 | si.si_pid; |
|
|
80 | si.si_uid; |
|
|
81 | si.si_value.sival_int; |
|
|
82 | si.si_value.sival_ptr; |
|
|
83 | return 0; |
|
|
84 | } |
|
|
85 | ])],ac_cv_siginfo_t=yes,ac_cv_siginfo_t=no)]) |
|
|
86 | test $ac_cv_siginfo_t = yes && AC_DEFINE(HAVE_SIGINFO_T, 1, have siginfo_t in signal.h) |
|
|
87 | |
|
|
88 | AC_CACHE_CHECK([for unix-style syscall interface], ac_cv_syscall, [AC_LINK_IFELSE([AC_LANG_SOURCE([ |
|
|
89 | #include <unistd.h> |
|
|
90 | #include <sys/syscall.h> |
|
|
91 | int main (void) |
|
|
92 | { |
|
|
93 | long res = syscall (SYS_exit, 0); |
|
|
94 | return 0; |
|
|
95 | } |
|
|
96 | ])],ac_cv_syscall=yes,ac_cv_syscall=no)]) |
|
|
97 | test $ac_cv_syscall = yes && AC_DEFINE(HAVE_SYSCALL, 1, unix syscall interface) |
|
|
98 | |
64 | AC_CACHE_CHECK([for splice, vmsplice and tee], ac_cv_linux_splice, [AC_LINK_IFELSE([AC_LANG_SOURCE([ |
99 | AC_CACHE_CHECK([for splice, vmsplice and tee], ac_cv_linux_splice, [AC_LINK_IFELSE([AC_LANG_SOURCE([ |
|
|
100 | #include <sys/types.h> |
65 | #include <fcntl.h> |
101 | #include <fcntl.h> |
|
|
102 | #include <sys/uio.h> |
66 | int main (void) |
103 | int main (void) |
67 | { |
104 | { |
68 | ssize_t res; |
105 | ssize_t res; |
69 | res = splice ((int)0, (loff_t)0, (int)0, (loff_t *)0, (size_t)0, SPLICE_F_MOVE | SPLICE_F_NONBLOCK | SPLICE_F_MORE); |
106 | res = splice ((int)0, (loff_t)0, (int)0, (loff_t *)0, (size_t)0, SPLICE_F_MOVE | SPLICE_F_NONBLOCK | SPLICE_F_MORE); |
70 | res = tee ((int)0, (int)0, (size_t)0, SPLICE_F_NONBLOCK); |
107 | res = tee ((int)0, (int)0, (size_t)0, SPLICE_F_NONBLOCK); |
… | |
… | |
75 | test $ac_cv_linux_splice = yes && AC_DEFINE(HAVE_LINUX_SPLICE, 1, splice/vmsplice/tee(2) are available) |
112 | test $ac_cv_linux_splice = yes && AC_DEFINE(HAVE_LINUX_SPLICE, 1, splice/vmsplice/tee(2) are available) |
76 | |
113 | |
77 | AC_CACHE_CHECK(for pipe2, ac_cv_pipe2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
114 | AC_CACHE_CHECK(for pipe2, ac_cv_pipe2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
78 | #include <fcntl.h> |
115 | #include <fcntl.h> |
79 | #include <unistd.h> |
116 | #include <unistd.h> |
|
|
117 | int main (void) |
|
|
118 | { |
80 | int res; |
119 | int res; |
81 | int main (void) |
|
|
82 | { |
|
|
83 | res = pipe2 (0, 0); |
120 | res = pipe2 (0, 0); |
84 | return 0; |
121 | return 0; |
85 | } |
122 | } |
86 | ]])],ac_cv_pipe2=yes,ac_cv_pipe2=no)]) |
123 | ]])],ac_cv_pipe2=yes,ac_cv_pipe2=no)]) |
87 | test $ac_cv_pipe2 = yes && AC_DEFINE(HAVE_PIPE2, 1, pipe2(2) is available) |
124 | test $ac_cv_pipe2 = yes && AC_DEFINE(HAVE_PIPE2, 1, pipe2(2) is available) |
88 | |
125 | |
89 | AC_CACHE_CHECK(for eventfd, ac_cv_eventfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
126 | AC_CACHE_CHECK(for eventfd, ac_cv_eventfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
90 | #include <sys/eventfd.h> |
127 | #include <sys/eventfd.h> |
|
|
128 | int main (void) |
|
|
129 | { |
91 | int res; |
130 | int res; |
92 | int main (void) |
|
|
93 | { |
|
|
94 | res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK); |
131 | res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK); |
95 | return 0; |
132 | return 0; |
96 | } |
133 | } |
97 | ]])],ac_cv_eventfd=yes,ac_cv_eventfd=no)]) |
134 | ]])],ac_cv_eventfd=yes,ac_cv_eventfd=no)]) |
98 | test $ac_cv_eventfd = yes && AC_DEFINE(HAVE_EVENTFD, 1, eventfd(2) is available) |
135 | test $ac_cv_eventfd = yes && AC_DEFINE(HAVE_EVENTFD, 1, eventfd(2) is available) |
99 | |
136 | |
100 | AC_CACHE_CHECK(for timerfd, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
137 | AC_CACHE_CHECK(for timerfd_*, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
101 | #include <sys/timerfd.h> |
138 | #include <sys/timerfd.h> |
102 | int res; |
|
|
103 | int main (void) |
139 | int main (void) |
104 | { |
140 | { |
105 | struct itimerspec its; |
141 | struct itimerspec its; |
|
|
142 | int res; |
106 | res = timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK); |
143 | res = timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK); |
107 | res = timerfd_settime (res, TFD_TIMER_ABSTIME /*| TFD_TIMER_CANCEL_ON_SET*/, &its, 0); |
144 | res = timerfd_settime (res, TFD_TIMER_ABSTIME /*| TFD_TIMER_CANCEL_ON_SET*/, &its, 0); |
108 | res = timerfd_gettime (res, &its); |
145 | res = timerfd_gettime (res, &its); |
109 | return 0; |
146 | return 0; |
110 | } |
147 | } |
111 | ]])],ac_cv_timerfd=yes,ac_cv_timerfd=no)]) |
148 | ]])],ac_cv_timerfd=yes,ac_cv_timerfd=no)]) |
112 | test $ac_cv_timerfd = yes && AC_DEFINE(HAVE_TIMERFD, 1, timerfd_*(2) are available) |
149 | test $ac_cv_timerfd = yes && AC_DEFINE(HAVE_TIMERFD, 1, timerfd_*(2) are available) |
|
|
150 | |
|
|
151 | AC_CACHE_CHECK(for memfd_create, ac_cv_memfd_create, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
152 | #include <sys/mman.h> |
|
|
153 | int main (void) |
|
|
154 | { |
|
|
155 | int res = memfd_create ("name", MFD_CLOEXEC | MFD_ALLOW_SEALING); |
|
|
156 | return 0; |
|
|
157 | } |
|
|
158 | ]])],ac_cv_memfd_create=yes,ac_cv_memfd_create=no)]) |
|
|
159 | test $ac_cv_memfd_create = yes && AC_DEFINE(HAVE_MEMFD_CREATE, 1, memfd_create(2) is available) |
113 | |
160 | |
114 | AC_CACHE_CHECK(for copy_file_range, ac_cv_copy_file_range, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
161 | AC_CACHE_CHECK(for copy_file_range, ac_cv_copy_file_range, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
115 | #include <unistd.h> |
162 | #include <unistd.h> |
116 | #include <sys/syscall.h> |
163 | #include <sys/syscall.h> |
117 | /*#include <linux/copy.h>*/ |
164 | /*#include <linux/copy.h>*/ |
|
|
165 | int main (void) |
|
|
166 | { |
118 | int res; |
167 | int res; |
119 | int main (void) |
|
|
120 | { |
|
|
121 | /*res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, COPY_FR_REFLINK | COPY_FR_DEDUP | COPY_FR_COPY);*/ |
168 | /*res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, COPY_FR_REFLINK | COPY_FR_DEDUP | COPY_FR_COPY);*/ |
122 | res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, 0); |
169 | res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, 0); |
123 | return 0; |
170 | return 0; |
124 | } |
171 | } |
125 | ]])],ac_cv_copy_file_range=yes,ac_cv_copy_file_range=no)]) |
172 | ]])],ac_cv_copy_file_range=yes,ac_cv_copy_file_range=no)]) |
… | |
… | |
128 | AC_CACHE_CHECK(for st_xtimensec, ac_cv_xtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
175 | AC_CACHE_CHECK(for st_xtimensec, ac_cv_xtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
129 | #include "EXTERN.h" |
176 | #include "EXTERN.h" |
130 | #include "perl.h" |
177 | #include "perl.h" |
131 | #include "XSUB.h" |
178 | #include "XSUB.h" |
132 | |
179 | |
133 | int res; |
|
|
134 | int main (void) |
180 | int main (void) |
135 | { |
181 | { |
136 | return PL_statcache.st_atimensec |
182 | return PL_statcache.st_atimensec |
137 | + PL_statcache.st_mtimensec |
183 | + PL_statcache.st_mtimensec |
138 | + PL_statcache.st_ctimensec; |
184 | + PL_statcache.st_ctimensec; |
139 | return 0; |
|
|
140 | } |
185 | } |
141 | ]])],ac_cv_xtimensec=yes,ac_cv_xtimensec=no)]) |
186 | ]])],ac_cv_xtimensec=yes,ac_cv_xtimensec=no)]) |
142 | test $ac_cv_xtimensec = yes && AC_DEFINE(HAVE_ST_XTIMENSEC, 1, stat nanosecond access by st_xtimensec) |
187 | test $ac_cv_xtimensec = yes && AC_DEFINE(HAVE_ST_XTIMENSEC, 1, stat nanosecond access by st_xtimensec) |
143 | |
188 | |
144 | AC_CACHE_CHECK(for st_xtimespec, ac_cv_xtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
189 | AC_CACHE_CHECK(for st_xtimespec, ac_cv_xtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
145 | #include "EXTERN.h" |
190 | #include "EXTERN.h" |
146 | #include "perl.h" |
191 | #include "perl.h" |
147 | #include "XSUB.h" |
192 | #include "XSUB.h" |
148 | |
193 | |
149 | int res; |
|
|
150 | int main (void) |
194 | int main (void) |
151 | { |
195 | { |
152 | return PL_statcache.st_atim.tv_nsec |
196 | return PL_statcache.st_atim.tv_nsec |
153 | + PL_statcache.st_mtim.tv_nsec |
197 | + PL_statcache.st_mtim.tv_nsec |
154 | + PL_statcache.st_ctim.tv_nsec; |
198 | + PL_statcache.st_ctim.tv_nsec; |
155 | } |
199 | } |
156 | ]])],ac_cv_xtimespec=yes,ac_cv_xtimespec=no)]) |
200 | ]])],ac_cv_xtimespec=yes,ac_cv_xtimespec=no)]) |
157 | test $ac_cv_xtimespec = yes && AC_DEFINE(HAVE_ST_XTIMESPEC, 1, stat nanosecond access by st_xtimespec) |
201 | test $ac_cv_xtimespec = yes && AC_DEFINE(HAVE_ST_XTIMESPEC, 1, stat nanosecond access by st_xtimespec) |
158 | |
202 | |
|
|
203 | # apparently, True64 uses st_u[amc]time, aix uses at_[amc]time_n and apple uses st_[amc,birth]timespec? |
|
|
204 | |
|
|
205 | AC_CACHE_CHECK(for st_birthtimensec, ac_cv_birthtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
|
|
206 | #include "EXTERN.h" |
|
|
207 | #include "perl.h" |
|
|
208 | #include "XSUB.h" |
|
|
209 | |
|
|
210 | int main (void) |
|
|
211 | { |
|
|
212 | return PL_statcache.st_birthtime + PL_statcache.st_birthtimensec; |
|
|
213 | } |
|
|
214 | ]])],ac_cv_birthtimensec=yes,ac_cv_birthtimensec=no)]) |
|
|
215 | test $ac_cv_birthtimensec = yes && AC_DEFINE(HAVE_ST_BIRTHTIMENSEC, 1, birthtime nanosecond access by st_birthtimensec) |
|
|
216 | |
|
|
217 | AC_CACHE_CHECK(for st_birthtimespec, ac_cv_birthtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
|
|
218 | #include "EXTERN.h" |
|
|
219 | #include "perl.h" |
|
|
220 | #include "XSUB.h" |
|
|
221 | |
|
|
222 | int main (void) |
|
|
223 | { |
|
|
224 | return PL_statcache.st_birthtim.tv_sec + PL_statcache.st_birthtim.tv_nsec; |
|
|
225 | } |
|
|
226 | ]])],ac_cv_birthtimespec=yes,ac_cv_birthtimespec=no)]) |
|
|
227 | test $ac_cv_birthtimespec = yes && AC_DEFINE(HAVE_ST_BIRTHTIMESPEC, 1, birthtime nanosecond access by st_birthtimespec) |
|
|
228 | |
|
|
229 | AC_CACHE_CHECK(for st_gen, ac_cv_st_gen, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
|
|
230 | #include "EXTERN.h" |
|
|
231 | #include "perl.h" |
|
|
232 | #include "XSUB.h" |
|
|
233 | |
|
|
234 | int main (void) |
|
|
235 | { |
|
|
236 | return PL_statcache.st_gen; |
|
|
237 | } |
|
|
238 | ]])],ac_cv_st_gen=yes,ac_cv_st_gen=no)]) |
|
|
239 | test $ac_cv_st_gen = yes && AC_DEFINE(HAVE_ST_GEN, 1, stat st_gen member) |
|
|
240 | |
|
|
241 | AC_CACHE_CHECK(for statx, ac_cv_statx, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
242 | #include <sys/types.h> |
|
|
243 | #include <sys/stat.h> |
|
|
244 | #include <unistd.h> |
|
|
245 | #include <fcntl.h> |
|
|
246 | int res; |
|
|
247 | int main (void) |
|
|
248 | { |
|
|
249 | struct statx sx; |
|
|
250 | int res; |
|
|
251 | res = statx (AT_FDCWD, ".", |
|
|
252 | AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | AT_STATX_SYNC_AS_STAT | AT_STATX_FORCE_SYNC | AT_STATX_DONT_SYNC, |
|
|
253 | STATX_ALL, &sx); |
|
|
254 | STATX_TYPE; STATX_MODE; STATX_NLINK; STATX_UID; STATX_GID; STATX_ATIME; STATX_MTIME; STATX_CTIME; |
|
|
255 | STATX_INO; STATX_SIZE; STATX_BLOCKS; STATX_BASIC_STATS; STATX_BTIME; STATX_ALL; |
|
|
256 | STATX_ATTR_COMPRESSED; STATX_ATTR_IMMUTABLE; STATX_ATTR_APPEND; STATX_ATTR_NODUMP; STATX_ATTR_ENCRYPTED; |
|
|
257 | return 0; |
|
|
258 | } |
|
|
259 | ]])],ac_cv_statx=yes,ac_cv_statx=no)]) |
|
|
260 | test $ac_cv_statx = yes && AC_DEFINE(HAVE_STATX, 1, statx(2) is available) |
|
|
261 | |
|
|
262 | AC_CACHE_CHECK(for accept4, ac_cv_accept4, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
263 | #include <sys/types.h> |
|
|
264 | #include <sys/socket.h> |
|
|
265 | int main (void) |
|
|
266 | { |
|
|
267 | int res = accept4 (1, (struct sockaddr *)0, (socklen_t)0, SOCK_NONBLOCK | SOCK_CLOEXEC); |
|
|
268 | return 0; |
|
|
269 | } |
|
|
270 | ]])],ac_cv_accept4=yes,ac_cv_accept4=no)]) |
|
|
271 | test $ac_cv_accept4 = yes && AC_DEFINE(HAVE_ACCEPT4, 1, accept4(2) is available) |
|
|
272 | |
|
|
273 | AC_CHECK_HEADERS([sys/mount.h]) |
|
|
274 | AC_CACHE_CHECK(for mount, ac_cv_mount, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
275 | #include <sys/mount.h> |
|
|
276 | int main (void) |
|
|
277 | { |
|
|
278 | int res = mount ("path", "path", "fstype", MS_RDONLY, 0); |
|
|
279 | return 0; |
|
|
280 | } |
|
|
281 | ]])],ac_cv_mount=yes,ac_cv_mount=no)]) |
|
|
282 | test $ac_cv_mount = yes && AC_DEFINE(HAVE_MOUNT, 1, mount is available) |
|
|
283 | AC_CACHE_CHECK(for umount, ac_cv_umount, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
284 | #include <sys/mount.h> |
|
|
285 | int main (void) |
|
|
286 | { |
|
|
287 | int res = umount ("path"); |
|
|
288 | return 0; |
|
|
289 | } |
|
|
290 | ]])],ac_cv_umount=yes,ac_cv_umount=no)]) |
|
|
291 | test $ac_cv_umount = yes && AC_DEFINE(HAVE_UMOUNT, 1, umount is available) |
|
|
292 | AC_CACHE_CHECK(for umount2, ac_cv_umount2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
293 | #include <sys/mount.h> |
|
|
294 | int main (void) |
|
|
295 | { |
|
|
296 | int res = umount2 ("path", MNT_FORCE|MNT_DETACH); |
|
|
297 | return 0; |
|
|
298 | } |
|
|
299 | ]])],ac_cv_umount2=yes,ac_cv_umount2=no)]) |
|
|
300 | test $ac_cv_umount2 = yes && AC_DEFINE(HAVE_UMOUNT2, 1, umount2 is available) |
|
|
301 | |
159 | AC_OUTPUT |
302 | AC_OUTPUT |
160 | |
303 | |