From: Niels Provos Date: Fri, 7 Mar 2003 23:21:01 +0000 (+0000) Subject: check for linux eventpoll X-Git-Tag: release-1.1b~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71e513296d99948e350e68bd0885af73c0bc7c6a;p=libevent check for linux eventpoll svn:r43 --- diff --git a/configure.in b/configure.in index 025ae34a..9b8793b1 100644 --- a/configure.in +++ b/configure.in @@ -20,7 +20,7 @@ dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(poll.h signal.h unistd.h sys/time.h sys/queue.h sys/event.h) +AC_CHECK_HEADERS(poll.h signal.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h) if test "x$ac_cv_header_sys_queue_h" = "xyes"; then AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h) AC_EGREP_CPP(yes, @@ -71,12 +71,15 @@ if test "x$havepoll" = "xyes" ; then needsignal=yes fi -if test "x$needsignal" = "xyes" ; then - AC_LIBOBJ([signal]) +haveepoll=no +AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], ) +if test "x$haveepoll" = "xyes" ; then + AC_DEFINE(HAVE_EPOLL, 1, + [Define if your system supports the epoll system calls]) + AC_LIBOBJ([epoll]) + needsignal=yes fi -AC_REPLACE_FUNCS(err) - havekqueue=no if test "x$ac_cv_header_sys_event_h" = "xyes"; then AC_CHECK_FUNCS(kqueue, [havekqueue=yes], ) @@ -134,6 +137,46 @@ main(int argc, char **argv) fi fi +haveepollsyscall=no +if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then + if test "x$haveepoll" = "xno" ; then + AC_MSG_CHECKING(for epoll system call) + AC_TRY_RUN( +#include +#include +#include +#include +#include +#include + +int +epoll_create(int size) +{ + return (syscall(__NR_epoll_create, size)); +} + +int +main(int argc, char **argv) +{ + int epfd; + + epfd = epoll_create(256); + exit (epfd == -1 ? 1 : 0); +}, [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_EPOLL, 1, + [Define if your system supports the epoll system calls]) + needsignal=yes + AC_LIBOBJ([epoll_sub]) + AC_LIBOBJ([epoll])], AC_MSG_RESULT(no), AC_MSG_RESULT(no)) + fi +fi + +if test "x$needsignal" = "xyes" ; then + AC_LIBOBJ([signal]) +fi + +AC_REPLACE_FUNCS(err) + AC_TYPE_PID_T AC_TYPE_SIZE_T AC_CHECK_TYPE(u_int64_t, unsigned long long)