From c6f05662899417ad22c4fa3217e6c2ba2d27b5a3 Mon Sep 17 00:00:00 2001 From: Florian Wilkemeyer Date: Sun, 10 Jan 2016 10:56:22 +0100 Subject: Added epoll as event-dispatcher on linux (instead of select()) Note: It will be enabled by default if configure detects that the system has support for epoll To enforce usage of select run configure with --enable-epoll=no --- configure.ac | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7b7590813..0e1c6b8bf 100644 --- a/configure.ac +++ b/configure.ac @@ -142,6 +142,33 @@ AC_ARG_ENABLE( ) +# +# Epoll +# +AC_ARG_ENABLE([epoll], + [AS_HELP_STRING([--enable-epoll],[use epoll(4) on Linux])], + [enable_epoll=$enableval], [enable_epoll=auto]) +if test x$enable_epoll = xno; then + have_linux_epoll=no +else + AC_MSG_CHECKING([for Linux epoll(4)]) + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [ + #ifndef __linux__ + #error This is not Linux + #endif + #include + ], + [epoll_create1 (EPOLL_CLOEXEC);])], + [have_linux_epoll=yes], + [have_linux_epoll=no]) + AC_MSG_RESULT([$have_linux_epoll]) +fi +if test x$enable_epoll,$have_linux_epoll = xyes,no; then + AC_MSG_ERROR([epoll support explicitly enabled but not available]) +fi + + # # Obfuscation keys # @@ -1138,6 +1165,18 @@ case $enable_packetver_re in ;; esac +# +# Epoll +# +case $have_linux_epoll in + "yes") + CPPFLAGS="$CPPFLAGS -DSOCKET_EPOLL" + ;; + "no") + # default value + ;; +esac + # # Obfuscation keys # -- cgit v1.2.3-60-g2f50