--- IO-AIO/configure.ac 2018/08/12 06:03:20 1.7 +++ IO-AIO/configure.ac 2019/09/06 22:03:09 1.15 @@ -14,10 +14,10 @@ AC_CACHE_CHECK(for set/getrlimit, ac_cv_rlimits, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include #include -int res; int main (void) { struct rlimit srl; + int res; srl.rlim_cur = srl.rlim_max = RLIM_INFINITY; res = getrlimit (RLIMIT_NOFILE, &srl); res = setrlimit (RLIMIT_NOFILE, &srl); @@ -61,8 +61,20 @@ dnl lots of linux specifics AC_CHECK_HEADERS([linux/fs.h linux/fiemap.h]) +dnl glibc major/minor macros +AC_CHECK_HEADERS([sys/sysmacros.h]) + +dnl solaris major/minor +AC_CHECK_HEADERS([sys/mkdev.h]) + +dnl readv / preadv, vmsplice +AC_CHECK_HEADERS([sys/uio.h]) + + AC_CACHE_CHECK([for splice, vmsplice and tee], ac_cv_linux_splice, [AC_LINK_IFELSE([AC_LANG_SOURCE([ +#include #include +#include int main (void) { ssize_t res; @@ -77,9 +89,9 @@ AC_CACHE_CHECK(for pipe2, ac_cv_pipe2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include #include -int res; int main (void) { + int res; res = pipe2 (0, 0); return 0; } @@ -88,21 +100,21 @@ AC_CACHE_CHECK(for eventfd, ac_cv_eventfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include -int res; int main (void) { + int res; res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK); return 0; } ]])],ac_cv_eventfd=yes,ac_cv_eventfd=no)]) test $ac_cv_eventfd = yes && AC_DEFINE(HAVE_EVENTFD, 1, eventfd(2) is available) -AC_CACHE_CHECK(for timerfd, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ +AC_CACHE_CHECK(for timerfd_*, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include -int res; int main (void) { struct itimerspec its; + int res; res = timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK); res = timerfd_settime (res, TFD_TIMER_ABSTIME /*| TFD_TIMER_CANCEL_ON_SET*/, &its, 0); res = timerfd_gettime (res, &its); @@ -111,13 +123,23 @@ ]])],ac_cv_timerfd=yes,ac_cv_timerfd=no)]) test $ac_cv_timerfd = yes && AC_DEFINE(HAVE_TIMERFD, 1, timerfd_*(2) are available) +AC_CACHE_CHECK(for memfd_create, ac_cv_memfd_create, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ +#include +int main (void) +{ + int res = memfd_create ("name", MFD_CLOEXEC | MFD_ALLOW_SEALING); + return 0; +} +]])],ac_cv_memfd_create=yes,ac_cv_memfd_create=no)]) +test $ac_cv_memfd_create = yes && AC_DEFINE(HAVE_MEMFD_CREATE, 1, memfd_create(2) is available) + AC_CACHE_CHECK(for copy_file_range, ac_cv_copy_file_range, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include #include /*#include */ -int res; int main (void) { + int res; /*res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, COPY_FR_REFLINK | COPY_FR_DEDUP | COPY_FR_COPY);*/ res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, 0); return 0; @@ -130,13 +152,11 @@ #include "perl.h" #include "XSUB.h" -int res; int main (void) { return PL_statcache.st_atimensec + PL_statcache.st_mtimensec + PL_statcache.st_ctimensec; - return 0; } ]])],ac_cv_xtimensec=yes,ac_cv_xtimensec=no)]) test $ac_cv_xtimensec = yes && AC_DEFINE(HAVE_ST_XTIMENSEC, 1, stat nanosecond access by st_xtimensec) @@ -146,7 +166,6 @@ #include "perl.h" #include "XSUB.h" -int res; int main (void) { return PL_statcache.st_atim.tv_nsec @@ -158,5 +177,74 @@ # apparently, True64 uses st_u[amc]time, aix uses at_[amc]time_n and apple uses st_[amc,birth]timespec? +AC_CACHE_CHECK(for st_birthtimensec, ac_cv_birthtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +int main (void) +{ + return PL_statcache.st_birthtime + PL_statcache.st_birthtimensec; +} +]])],ac_cv_birthtimensec=yes,ac_cv_birthtimensec=no)]) +test $ac_cv_birthtimensec = yes && AC_DEFINE(HAVE_ST_BIRTHTIMENSEC, 1, birthtime nanosecond access by st_birthtimensec) + +AC_CACHE_CHECK(for st_birthtimespec, ac_cv_birthtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +int main (void) +{ + return PL_statcache.st_birthtim.tv_sec + PL_statcache.st_birthtim.tv_nsec; +} +]])],ac_cv_birthtimespec=yes,ac_cv_birthtimespec=no)]) +test $ac_cv_birthtimespec = yes && AC_DEFINE(HAVE_ST_BIRTHTIMESPEC, 1, birthtime nanosecond access by st_birthtimespec) + +AC_CACHE_CHECK(for st_gen, ac_cv_st_gen, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +int main (void) +{ + return PL_statcache.st_gen; +} +]])],ac_cv_st_gen=yes,ac_cv_st_gen=no)]) +test $ac_cv_st_gen = yes && AC_DEFINE(HAVE_ST_GEN, 1, stat st_gen member) + +AC_CACHE_CHECK(for statx, ac_cv_statx, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include +#include +int res; +int main (void) +{ + struct statx sx; + int res; + res = statx (AT_FDCWD, ".", + AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | AT_STATX_SYNC_AS_STAT | AT_STATX_FORCE_SYNC | AT_STATX_DONT_SYNC, + STATX_ALL, &sx); + STATX_TYPE; STATX_MODE; STATX_NLINK; STATX_UID; STATX_GID; STATX_ATIME; STATX_MTIME; STATX_CTIME; + STATX_INO; STATX_SIZE; STATX_BLOCKS; STATX_BASIC_STATS; STATX_BTIME; STATX_ALL; + STATX_ATTR_COMPRESSED; STATX_ATTR_IMMUTABLE; STATX_ATTR_APPEND; STATX_ATTR_NODUMP; STATX_ATTR_ENCRYPTED; + return 0; +} +]])],ac_cv_statx=yes,ac_cv_statx=no)]) +test $ac_cv_statx = yes && AC_DEFINE(HAVE_STATX, 1, statx(2) is available) + +AC_CACHE_CHECK(for accept4, ac_cv_accept4, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ +#include +#include +int main (void) +{ + int res; + res = accept4 (1, (struct sockaddr *)0, (socklen_t)0, SOCK_NONBLOCK | SOCK_CLOEXEC); + return 0; +} +]])],ac_cv_accept4=yes,ac_cv_accept4=no)]) +test $ac_cv_accept4 = yes && AC_DEFINE(HAVE_ACCEPT4, 1, accept4(2) is available) + AC_OUTPUT