… | |
… | |
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 | |
67 | AC_CACHE_CHECK([for splice, vmsplice and tee], ac_cv_linux_splice, [AC_LINK_IFELSE([AC_LANG_SOURCE([ |
74 | AC_CACHE_CHECK([for splice, vmsplice and tee], ac_cv_linux_splice, [AC_LINK_IFELSE([AC_LANG_SOURCE([ |
|
|
75 | #include <sys/types.h> |
68 | #include <fcntl.h> |
76 | #include <fcntl.h> |
|
|
77 | #include <sys/uio.h> |
69 | int main (void) |
78 | int main (void) |
70 | { |
79 | { |
71 | ssize_t res; |
80 | 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); |
81 | 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); |
82 | 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) |
87 | test $ac_cv_linux_splice = yes && AC_DEFINE(HAVE_LINUX_SPLICE, 1, splice/vmsplice/tee(2) are available) |
79 | |
88 | |
80 | AC_CACHE_CHECK(for pipe2, ac_cv_pipe2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
89 | AC_CACHE_CHECK(for pipe2, ac_cv_pipe2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
81 | #include <fcntl.h> |
90 | #include <fcntl.h> |
82 | #include <unistd.h> |
91 | #include <unistd.h> |
|
|
92 | int main (void) |
|
|
93 | { |
83 | int res; |
94 | int res; |
84 | int main (void) |
|
|
85 | { |
|
|
86 | res = pipe2 (0, 0); |
95 | res = pipe2 (0, 0); |
87 | return 0; |
96 | return 0; |
88 | } |
97 | } |
89 | ]])],ac_cv_pipe2=yes,ac_cv_pipe2=no)]) |
98 | ]])],ac_cv_pipe2=yes,ac_cv_pipe2=no)]) |
90 | test $ac_cv_pipe2 = yes && AC_DEFINE(HAVE_PIPE2, 1, pipe2(2) is available) |
99 | test $ac_cv_pipe2 = yes && AC_DEFINE(HAVE_PIPE2, 1, pipe2(2) is available) |
91 | |
100 | |
92 | AC_CACHE_CHECK(for eventfd, ac_cv_eventfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
101 | AC_CACHE_CHECK(for eventfd, ac_cv_eventfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
93 | #include <sys/eventfd.h> |
102 | #include <sys/eventfd.h> |
|
|
103 | int main (void) |
|
|
104 | { |
94 | int res; |
105 | int res; |
95 | int main (void) |
|
|
96 | { |
|
|
97 | res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK); |
106 | res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK); |
98 | return 0; |
107 | return 0; |
99 | } |
108 | } |
100 | ]])],ac_cv_eventfd=yes,ac_cv_eventfd=no)]) |
109 | ]])],ac_cv_eventfd=yes,ac_cv_eventfd=no)]) |
101 | test $ac_cv_eventfd = yes && AC_DEFINE(HAVE_EVENTFD, 1, eventfd(2) is available) |
110 | test $ac_cv_eventfd = yes && AC_DEFINE(HAVE_EVENTFD, 1, eventfd(2) is available) |
102 | |
111 | |
103 | AC_CACHE_CHECK(for timerfd, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
112 | AC_CACHE_CHECK(for timerfd_*, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
104 | #include <sys/timerfd.h> |
113 | #include <sys/timerfd.h> |
105 | int res; |
|
|
106 | int main (void) |
114 | int main (void) |
107 | { |
115 | { |
108 | struct itimerspec its; |
116 | struct itimerspec its; |
|
|
117 | int res; |
109 | res = timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK); |
118 | res = timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK); |
110 | res = timerfd_settime (res, TFD_TIMER_ABSTIME /*| TFD_TIMER_CANCEL_ON_SET*/, &its, 0); |
119 | res = timerfd_settime (res, TFD_TIMER_ABSTIME /*| TFD_TIMER_CANCEL_ON_SET*/, &its, 0); |
111 | res = timerfd_gettime (res, &its); |
120 | res = timerfd_gettime (res, &its); |
112 | return 0; |
121 | return 0; |
113 | } |
122 | } |
114 | ]])],ac_cv_timerfd=yes,ac_cv_timerfd=no)]) |
123 | ]])],ac_cv_timerfd=yes,ac_cv_timerfd=no)]) |
115 | test $ac_cv_timerfd = yes && AC_DEFINE(HAVE_TIMERFD, 1, timerfd_*(2) are available) |
124 | test $ac_cv_timerfd = yes && AC_DEFINE(HAVE_TIMERFD, 1, timerfd_*(2) are available) |
|
|
125 | |
|
|
126 | AC_CACHE_CHECK(for memfd_create, ac_cv_memfd_create, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
127 | #include <sys/mman.h> |
|
|
128 | int main (void) |
|
|
129 | { |
|
|
130 | int res = memfd_create ("name", MFD_CLOEXEC | MFD_ALLOW_SEALING); |
|
|
131 | return 0; |
|
|
132 | } |
|
|
133 | ]])],ac_cv_memfd_create=yes,ac_cv_memfd_create=no)]) |
|
|
134 | test $ac_cv_memfd_create = yes && AC_DEFINE(HAVE_MEMFD_CREATE, 1, memfd_create(2) is available) |
116 | |
135 | |
117 | AC_CACHE_CHECK(for copy_file_range, ac_cv_copy_file_range, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
136 | AC_CACHE_CHECK(for copy_file_range, ac_cv_copy_file_range, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
118 | #include <unistd.h> |
137 | #include <unistd.h> |
119 | #include <sys/syscall.h> |
138 | #include <sys/syscall.h> |
120 | /*#include <linux/copy.h>*/ |
139 | /*#include <linux/copy.h>*/ |
|
|
140 | int main (void) |
|
|
141 | { |
121 | int res; |
142 | 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);*/ |
143 | /*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); |
144 | res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, 0); |
126 | return 0; |
145 | return 0; |
127 | } |
146 | } |
128 | ]])],ac_cv_copy_file_range=yes,ac_cv_copy_file_range=no)]) |
147 | ]])],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([[ |
150 | AC_CACHE_CHECK(for st_xtimensec, ac_cv_xtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
132 | #include "EXTERN.h" |
151 | #include "EXTERN.h" |
133 | #include "perl.h" |
152 | #include "perl.h" |
134 | #include "XSUB.h" |
153 | #include "XSUB.h" |
135 | |
154 | |
136 | int res; |
|
|
137 | int main (void) |
155 | int main (void) |
138 | { |
156 | { |
139 | return PL_statcache.st_atimensec |
157 | return PL_statcache.st_atimensec |
140 | + PL_statcache.st_mtimensec |
158 | + PL_statcache.st_mtimensec |
141 | + PL_statcache.st_ctimensec; |
159 | + PL_statcache.st_ctimensec; |
142 | return 0; |
|
|
143 | } |
160 | } |
144 | ]])],ac_cv_xtimensec=yes,ac_cv_xtimensec=no)]) |
161 | ]])],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) |
162 | test $ac_cv_xtimensec = yes && AC_DEFINE(HAVE_ST_XTIMENSEC, 1, stat nanosecond access by st_xtimensec) |
146 | |
163 | |
147 | AC_CACHE_CHECK(for st_xtimespec, ac_cv_xtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
164 | AC_CACHE_CHECK(for st_xtimespec, ac_cv_xtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
148 | #include "EXTERN.h" |
165 | #include "EXTERN.h" |
149 | #include "perl.h" |
166 | #include "perl.h" |
150 | #include "XSUB.h" |
167 | #include "XSUB.h" |
151 | |
168 | |
152 | int res; |
|
|
153 | int main (void) |
169 | int main (void) |
154 | { |
170 | { |
155 | return PL_statcache.st_atim.tv_nsec |
171 | return PL_statcache.st_atim.tv_nsec |
156 | + PL_statcache.st_mtim.tv_nsec |
172 | + PL_statcache.st_mtim.tv_nsec |
157 | + PL_statcache.st_ctim.tv_nsec; |
173 | + PL_statcache.st_ctim.tv_nsec; |
… | |
… | |
159 | ]])],ac_cv_xtimespec=yes,ac_cv_xtimespec=no)]) |
175 | ]])],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) |
176 | test $ac_cv_xtimespec = yes && AC_DEFINE(HAVE_ST_XTIMESPEC, 1, stat nanosecond access by st_xtimespec) |
161 | |
177 | |
162 | # apparently, True64 uses st_u[amc]time, aix uses at_[amc]time_n and apple uses st_[amc,birth]timespec? |
178 | # apparently, True64 uses st_u[amc]time, aix uses at_[amc]time_n and apple uses st_[amc,birth]timespec? |
163 | |
179 | |
|
|
180 | AC_CACHE_CHECK(for st_birthtimensec, ac_cv_birthtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
|
|
181 | #include "EXTERN.h" |
|
|
182 | #include "perl.h" |
|
|
183 | #include "XSUB.h" |
|
|
184 | |
|
|
185 | int main (void) |
|
|
186 | { |
|
|
187 | return PL_statcache.st_birthtime + PL_statcache.st_birthtimensec; |
|
|
188 | } |
|
|
189 | ]])],ac_cv_birthtimensec=yes,ac_cv_birthtimensec=no)]) |
|
|
190 | test $ac_cv_birthtimensec = yes && AC_DEFINE(HAVE_ST_BIRTHTIMENSEC, 1, birthtime nanosecond access by st_birthtimensec) |
|
|
191 | |
|
|
192 | AC_CACHE_CHECK(for st_birthtimespec, ac_cv_birthtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
|
|
193 | #include "EXTERN.h" |
|
|
194 | #include "perl.h" |
|
|
195 | #include "XSUB.h" |
|
|
196 | |
|
|
197 | int main (void) |
|
|
198 | { |
|
|
199 | return PL_statcache.st_birthtim.tv_sec + PL_statcache.st_birthtim.tv_nsec; |
|
|
200 | } |
|
|
201 | ]])],ac_cv_birthtimespec=yes,ac_cv_birthtimespec=no)]) |
|
|
202 | test $ac_cv_birthtimespec = yes && AC_DEFINE(HAVE_ST_BIRTHTIMESPEC, 1, birthtime nanosecond access by st_birthtimespec) |
|
|
203 | |
|
|
204 | AC_CACHE_CHECK(for st_gen, ac_cv_st_gen, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
|
|
205 | #include "EXTERN.h" |
|
|
206 | #include "perl.h" |
|
|
207 | #include "XSUB.h" |
|
|
208 | |
|
|
209 | int main (void) |
|
|
210 | { |
|
|
211 | return PL_statcache.st_gen; |
|
|
212 | } |
|
|
213 | ]])],ac_cv_st_gen=yes,ac_cv_st_gen=no)]) |
|
|
214 | test $ac_cv_st_gen = yes && AC_DEFINE(HAVE_ST_GEN, 1, stat st_gen member) |
|
|
215 | |
|
|
216 | AC_CACHE_CHECK(for statx, ac_cv_statx, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
|
217 | #include <sys/types.h> |
|
|
218 | #include <sys/stat.h> |
|
|
219 | #include <unistd.h> |
|
|
220 | #include <fcntl.h> |
|
|
221 | int res; |
|
|
222 | int main (void) |
|
|
223 | { |
|
|
224 | struct statx sx; |
|
|
225 | int res; |
|
|
226 | res = statx (AT_FDCWD, ".", |
|
|
227 | AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | AT_STATX_SYNC_AS_STAT | AT_STATX_FORCE_SYNC | AT_STATX_DONT_SYNC, |
|
|
228 | STATX_ALL, &sx); |
|
|
229 | STATX_TYPE; STATX_MODE; STATX_NLINK; STATX_UID; STATX_GID; STATX_ATIME; STATX_MTIME; STATX_CTIME; |
|
|
230 | STATX_INO; STATX_SIZE; STATX_BLOCKS; STATX_BASIC_STATS; STATX_BTIME; STATX_ALL; |
|
|
231 | STATX_ATTR_COMPRESSED; STATX_ATTR_IMMUTABLE; STATX_ATTR_APPEND; STATX_ATTR_NODUMP; STATX_ATTR_ENCRYPTED; |
|
|
232 | return 0; |
|
|
233 | } |
|
|
234 | ]])],ac_cv_statx=yes,ac_cv_statx=no)]) |
|
|
235 | test $ac_cv_statx = yes && AC_DEFINE(HAVE_STATX, 1, statx(2) is available) |
|
|
236 | |
164 | AC_OUTPUT |
237 | AC_OUTPUT |
165 | |
238 | |