]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Replace platform ISC_PLATFORM_HAVEEPOLL with config HAVE_EPOLL_CREATE1
authorOndřej Surý <ondrej@sury.org>
Wed, 5 Sep 2018 10:14:27 +0000 (12:14 +0200)
committerOndřej Surý <ondrej@sury.org>
Fri, 7 Sep 2018 10:17:30 +0000 (12:17 +0200)
config.h.in
configure
configure.in
lib/isc/include/isc/platform.h.in
lib/isc/unix/socket.c

index 3cb938fc2c56dc2cd92e49536d17cf2d902ea770..4cd770ac7ae604337077dcd795545521f8098a22 100644 (file)
 /* Define to 1 if you have the <edit/readline/readline.h> 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
 
index 1204a0ce88a3f57e4e6c28906f55a5a9f10e6f2c..ac8b8224a718a1ea2544c4721e573a159c85e569 100755 (executable)
--- 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
 #
 # 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 <sys/epoll.h>
-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
index fd8259ce1cc1ba5b48d786c00dff31c2c3d01517..982a36dcf6fe195564c5051fc429a76445dcfaa7 100644 (file)
@@ -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 <sys/epoll.h>
-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
index f0888d1c4c0146570c6a58c75cc946865e586d27..cda8611047acdcb681fb138b474207d1a7bb5bbc 100644 (file)
  */
 @ISC_PLATFORM_HAVETFO@
 
-/*! \brief
- * Define if the system supports epoll multiplexing
- */
-@ISC_PLATFORM_HAVEEPOLL@
-
 /*! \brief
  * Define if the system supports /dev/poll multiplexing
  */
index 9acac6905251ac94f108adfa2f00f26192f19b41..8185f485a049c42b670d12671b55855a2e4c0e10 100644 (file)
@@ -68,7 +68,7 @@
 #ifdef HAVE_KQUEUE
 #include <sys/event.h>
 #endif
-#ifdef ISC_PLATFORM_HAVEEPOLL
+#ifdef HAVE_EPOLL_CREATE1
 #include <sys/epoll.h>
 #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