--- libeio/libeio.m4 2017/06/23 22:15:24 1.27 +++ libeio/libeio.m4 2018/01/06 01:04:43 1.29 @@ -145,6 +145,21 @@ dnl ############################################################################# dnl # these checks exist for the benefit of IO::AIO +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; + srl.rlim_cur = srl.rlim_max = RLIM_INFINITY; + res = getrlimit (RLIMIT_NOFILE, &srl); + res = setrlimit (RLIMIT_NOFILE, &srl); + return 0; +} +]])],ac_cv_rlimits=yes,ac_cv_rlimits=no)]) +test $ac_cv_rlimits = yes && AC_DEFINE(HAVE_RLIMITS, 1, setrlimit/getrlimit is available) + dnl at least uclibc defines _POSIX_ADVISORY_INFO without *any* of the required dnl functionality actually being present. ugh. AC_CACHE_CHECK(for posix_madvise, ac_cv_posix_madvise, [AC_LINK_IFELSE([AC_LANG_SOURCE([ @@ -232,3 +247,14 @@ ]])],ac_cv_copy_file_range=yes,ac_cv_copy_file_range=no)]) test $ac_cv_copy_file_range = yes && AC_DEFINE(HAVE_COPY_FILE_RANGE, 1, copy_file_range(2) is available) +AC_CACHE_CHECK(for posix_close, ac_cv_posix_close, [AC_LINK_IFELSE([AC_LANG_SOURCE([[ +#include +int res; +int main (void) +{ + res = posix_close (0, 0); /* we do not need any flags */ + return 0; +} +]])],ac_cv_posix_close=yes,ac_cv_posix_close=no)]) +test $ac_cv_posix_close = yes && AC_DEFINE(HAVE_POSIX_CLOSE, 1, posix_close(2) is available) +