diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/configure.in b/configure.in index 9e828ec6a..2225cb0a4 100644 --- a/configure.in +++ b/configure.in @@ -1099,7 +1099,7 @@ AC_CACHE_CHECK([for epoll support], [apr_cv_epoll], #include <sys/epoll.h> #include <unistd.h> -int main() +int main(int argc, const char *argv[]) { return epoll_create(5) == -1; }], [apr_cv_epoll=yes], [apr_cv_epoll=no], [apr_cv_epoll=no])]) @@ -1115,7 +1115,7 @@ AC_CACHE_CHECK([for epoll_create1 support], [apr_cv_epoll_create1], #include <sys/epoll.h> #include <unistd.h> -int main() +int main(int argc, const char *argv[]) { return epoll_create1(0) == -1; }], [apr_cv_epoll_create1=yes], [apr_cv_epoll_create1=no], [apr_cv_epoll_create1=no])]) @@ -1124,6 +1124,47 @@ if test "$apr_cv_epoll_create1" = "yes"; then AC_DEFINE([HAVE_EPOLL_CREATE1], 1, [Define if epoll_create1 function is supported]) fi +# check if epoll_wait() timeout is a reliable as min min +AC_CACHE_CHECK([whether epoll_wait has a reliable timeout (min)], + [apr_cv_epoll_wait_has_reliable_timeout], +[AC_TRY_RUN([ +#include <unistd.h> +#include <sys/epoll.h> +#include <sys/time.h> /* for gettimeofday */ + +#define TV2US(tv) ((long long)(tv).tv_sec * 1000000 + (tv).tv_usec) + +int main(int argc, const char *argv[]) +{ + int ret = 0, fd, i; + struct epoll_event events; + struct timeval t1, t2; + +#ifdef HAVE_EPOLL_CREATE1 + fd = epoll_create1(0); +#else + fd = epoll_create(1); +#endif + if (fd < 0) { + return 1; + } + for (i = 0; i < 10; ++i) { + (void)gettimeofday(&t1, NULL); + (void)epoll_wait(fd, &events, 1, 100); /* ms */ + (void)gettimeofday(&t2, NULL); + ret |= (TV2US(t2) - TV2US(t1)) < 100000; /* us */ + } + close(fd); + return ret; +}], [apr_cv_epoll_wait_has_reliable_timeout=yes], + [apr_cv_epoll_wait_has_reliable_timeout=no], + [apr_cv_epoll_wait_has_reliable_timeout=no])]) + +if test "$apr_cv_epoll_wait_has_reliable_timeout" = "yes"; then + AC_DEFINE([HAVE_EPOLL_WAIT_RELIABLE_TIMEOUT], 1, + [Define if epoll_wait has a reliable timeout (min)]) +fi + # Check for z/OS async i/o support. AC_CACHE_CHECK([for asio -> message queue support], [apr_cv_aio_msgq], [AC_TRY_RUN([ |