--- IO-AIO/configure 2017/06/23 03:23:19 1.18 +++ IO-AIO/configure 2018/08/12 06:10:31 1.24 @@ -2020,7 +2020,7 @@ -ac_config_headers="$ac_config_headers libeio/config.h" +ac_config_headers="$ac_config_headers config.h" @@ -4200,6 +4200,108 @@ $as_echo "#define HAVE_PRCTL_SET_NAME 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix_close" >&5 +$as_echo_n "checking for posix_close... " >&6; } +if ${ac_cv_posix_close+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int res; +int main (void) +{ + res = posix_close (0, 0); /* we do not need any flags */ + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_posix_close=yes +else + ac_cv_posix_close=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_posix_close" >&5 +$as_echo "$ac_cv_posix_close" >&6; } +test $ac_cv_posix_close = yes && +$as_echo "#define HAVE_POSIX_CLOSE 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for renameat2" >&5 +$as_echo_n "checking for renameat2... " >&6; } +if ${ac_cv_renameat2+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int res; +int main (void) +{ + res = syscall (SYS_renameat2, 0, 0, 0, 0, RENAME_EXCHANGE | RENAME_NOREPLACE); + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_renameat2=yes +else + ac_cv_renameat2=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_renameat2" >&5 +$as_echo "$ac_cv_renameat2" >&6; } +test $ac_cv_renameat2 = yes && +$as_echo "#define HAVE_RENAMEAT2 1" >>confdefs.h + + + + +# for these to work, you need to run autoheader in IO::AIO, not libeio :( + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for set/getrlimit" >&5 +$as_echo_n "checking for set/getrlimit... " >&6; } +if ${ac_cv_rlimits+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +int res; +int main (void) +{ + struct rlimit srl; + srl.rlim_cur = srl.rlim_max = RLIM_INFINITY; + res = getrlimit (RLIMIT_NOFILE, &srl); + res = setrlimit (RLIMIT_NOFILE, &srl); + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_rlimits=yes +else + ac_cv_rlimits=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rlimits" >&5 +$as_echo "$ac_cv_rlimits" >&6; } +test $ac_cv_rlimits = yes && +$as_echo "#define HAVE_RLIMITS 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix_madvise" >&5 $as_echo_n "checking for posix_madvise... " >&6; } @@ -4350,9 +4452,74 @@ $as_echo "#define HAVE_PIPE2 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for renameat2" >&5 -$as_echo_n "checking for renameat2... " >&6; } -if ${ac_cv_renameat2+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for eventfd" >&5 +$as_echo_n "checking for eventfd... " >&6; } +if ${ac_cv_eventfd+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int res; +int main (void) +{ + res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK); + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_eventfd=yes +else + ac_cv_eventfd=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_eventfd" >&5 +$as_echo "$ac_cv_eventfd" >&6; } +test $ac_cv_eventfd = yes && +$as_echo "#define HAVE_EVENTFD 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for timerfd" >&5 +$as_echo_n "checking for timerfd... " >&6; } +if ${ac_cv_timerfd+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int res; +int main (void) +{ + struct itimerspec its; + 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); + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_timerfd=yes +else + ac_cv_timerfd=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_timerfd" >&5 +$as_echo "$ac_cv_timerfd" >&6; } +test $ac_cv_timerfd = yes && +$as_echo "#define HAVE_TIMERFD 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for copy_file_range" >&5 +$as_echo_n "checking for copy_file_range... " >&6; } +if ${ac_cv_copy_file_range+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4360,30 +4527,100 @@ #include #include -#include +/*#include */ int res; int main (void) { - res = syscall (SYS_renameat2, 0, 0, 0, 0, RENAME_EXCHANGE | RENAME_NOREPLACE); + /*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; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_renameat2=yes + ac_cv_copy_file_range=yes else - ac_cv_renameat2=no + ac_cv_copy_file_range=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_renameat2" >&5 -$as_echo "$ac_cv_renameat2" >&6; } -test $ac_cv_renameat2 = yes && -$as_echo "#define HAVE_RENAMEAT2 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_copy_file_range" >&5 +$as_echo "$ac_cv_copy_file_range" >&6; } +test $ac_cv_copy_file_range = yes && +$as_echo "#define HAVE_COPY_FILE_RANGE 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_xtimensec" >&5 +$as_echo_n "checking for st_xtimensec... " >&6; } +if ${ac_cv_xtimensec+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "EXTERN.h" +#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; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_xtimensec=yes +else + ac_cv_xtimensec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_xtimensec" >&5 +$as_echo "$ac_cv_xtimensec" >&6; } +test $ac_cv_xtimensec = yes && +$as_echo "#define HAVE_ST_XTIMENSEC 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_xtimespec" >&5 +$as_echo_n "checking for st_xtimespec... " >&6; } +if ${ac_cv_xtimespec+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +int res; +int main (void) +{ + return PL_statcache.st_atim.tv_nsec + + PL_statcache.st_mtim.tv_nsec + + PL_statcache.st_ctim.tv_nsec; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_xtimespec=yes +else + ac_cv_xtimespec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_xtimespec" >&5 +$as_echo "$ac_cv_xtimespec" >&6; } +test $ac_cv_xtimespec = yes && +$as_echo "#define HAVE_ST_XTIMESPEC 1" >>confdefs.h + + +# apparently, True64 uses st_u[amc]time, aix uses at_[amc]time_n and apple uses st_[amc,birth]timespec? cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -5057,7 +5294,7 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in - "libeio/config.h") CONFIG_HEADERS="$CONFIG_HEADERS libeio/config.h" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac @@ -5402,3 +5639,4 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi +