diff --git a/config.h.in b/config.h.in index 3cb938fc2c..4cd770ac7a 100644 --- a/config.h.in +++ b/config.h.in @@ -188,6 +188,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_EDIT_READLINE_READLINE_H +/* Define to 1 if you have the `epoll_create1' function. */ +#undef HAVE_EPOLL_CREATE1 + /* Define to 1 if you have the `EVP_aes_128_ecb' function. */ #undef HAVE_EVP_AES_128_ECB diff --git a/configure b/configure index 1204a0ce88..ac8b8224a7 100755 --- a/configure +++ b/configure @@ -763,7 +763,6 @@ CHECK_DSA GEOIPLINKOBJS GEOIPLINKSRCS ISC_PLATFORM_HAVEDEVPOLL -ISC_PLATFORM_HAVEEPOLL ISC_PLATFORM_NORETURN_POST ISC_PLATFORM_NORETURN_PRE ISC_SOCKADDR_LEN_T @@ -13905,53 +13904,25 @@ fi # # Check whether --enable-epoll was given. if test "${enable_epoll+set}" = set; then : - enableval=$enable_epoll; want_epoll="$enableval" + enableval=$enable_epoll; else - want_epoll="auto" + enable_epoll="yes" fi -case $want_epoll in -auto) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking epoll support" >&5 -$as_echo_n "checking epoll support... " >&6; } - if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int main() { - if (epoll_create(1) < 0) - return (1); - return (0); -} +if test "$enable_epoll" = "yes"; then : + for ac_func in epoll_create1 +do : + ac_fn_c_check_func "$LINENO" "epoll_create1" "ac_cv_func_epoll_create1" +if test "x$ac_cv_func_epoll_create1" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_EPOLL_CREATE1 1 _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL" -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - ;; -yes) - ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1" - ;; -*) - ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL" - ;; -esac +fi +done +fi # # check if we support /dev/poll diff --git a/configure.in b/configure.in index fd8259ce1c..982a36dcf6 100644 --- a/configure.in +++ b/configure.in @@ -543,36 +543,13 @@ AS_IF([test "$enable_kqueue" = "yes"], # check if we have epoll. Linux kernel 2.4 has epoll_create() which fails, # so we need to try running the code, not just test its existence. # -AC_ARG_ENABLE(epoll, - AS_HELP_STRING([--enable-epoll], - [use Linux epoll when available [default=auto]]), - want_epoll="$enableval", want_epoll="auto") -case $want_epoll in -auto) - AC_MSG_CHECKING(epoll support) - AC_TRY_RUN([ -#include -int main() { - if (epoll_create(1) < 0) - return (1); - return (0); -} -], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"], - [AC_MSG_RESULT(no) - ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"], - [AC_MSG_RESULT(no) - ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"]) - ;; -yes) - ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1" - ;; -*) - ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL" - ;; -esac -AC_SUBST(ISC_PLATFORM_HAVEEPOLL) +AC_ARG_ENABLE([epoll], + [AS_HELP_STRING([--enable-epoll], + [use Linux epoll when available [default=auto]])], + [], [enable_epoll="yes"]) + +AS_IF([test "$enable_epoll" = "yes"], + [AC_CHECK_FUNCS([epoll_create1])]) # # check if we support /dev/poll diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in index f0888d1c4c..cda8611047 100644 --- a/lib/isc/include/isc/platform.h.in +++ b/lib/isc/include/isc/platform.h.in @@ -47,11 +47,6 @@ */ @ISC_PLATFORM_HAVETFO@ -/*! \brief - * Define if the system supports epoll multiplexing - */ -@ISC_PLATFORM_HAVEEPOLL@ - /*! \brief * Define if the system supports /dev/poll multiplexing */ diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 9acac69052..8185f485a0 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -68,7 +68,7 @@ #ifdef HAVE_KQUEUE #include #endif -#ifdef ISC_PLATFORM_HAVEEPOLL +#ifdef HAVE_EPOLL_CREATE1 #include #endif #ifdef ISC_PLATFORM_HAVEDEVPOLL @@ -96,7 +96,7 @@ */ #if defined(HAVE_KQUEUE) #define USE_KQUEUE -#elif defined (ISC_PLATFORM_HAVEEPOLL) +#elif defined(HAVE_EPOLL_CREATE1) #define USE_EPOLL #elif defined (ISC_PLATFORM_HAVEDEVPOLL) #define USE_DEVPOLL