Re: epoll

From: Adrian Chadd <adrian@dont-contact.us>
Date: Thu, 19 Feb 2004 20:19:44 -0700

On Thu, Feb 19, 2004, David Nicklay wrote:
> Hi,
>
> I second Henrik's suggestion. The epoll stuff actually works on 2.4
> kernels with a patch, and almost none of those have the new epoll stuff
> in glibc.
>
> Also, it would be nice if someone could fix the autoconf scripts, so I
> don't have to do:
>
> --disable-select
> --disable-poll
> --enable-epoll

yup, this has to do with the order we're checking poll/select/epoll/kqueue.
Here's my configure.in patch, it seems to do the right thing.
Give it a shot?

Index: configure.in
===================================================================
RCS file: /server/cvs-server/squid/squid3/configure.in,v
retrieving revision 1.350
diff -u -r1.350 configure.in
--- configure.in 15 Sep 2003 01:27:09 -0000 1.350
+++ configure.in 20 Feb 2004 03:17:28 -0000
@@ -871,7 +871,7 @@
     echo "Forcing epoll() to be enabled"
     ac_cv_func_epoll='yes'
         if test -z "$EPOLL_LIBS"; then
- EPOLL_LIBS="-lepoll"
+ EPOLL_LIBS=""
         fi
         AC_SUBST(EPOLL_LIBS)
         AM_CONDITIONAL(USE_EPOLL, true)
@@ -1989,18 +1989,18 @@
 dnl Actually do the define magic now
 dnl mostly ripped from squid-commloops, thanks to adrian and benno

-if test "$ac_cv_func_poll" = "yes" ; then
- SELECT_TYPE="poll"
- AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
-elif test "$ac_cv_func_select" = "yes" ; then
- SELECT_TYPE="select"
- AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
-elif test "$ac_cv_func_kqueue" = "yes" ; then
+if test "$ac_cv_func_kqueue" = "yes" ; then
        SELECT_TYPE="kqueue"
        AC_DEFINE(USE_KQUEUE,1,[Use kqueue() for the IO loop])
 elif test "$ac_cv_func_epoll" = "yes" ; then
        SELECT_TYPE="epoll"
        AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop])
+elif test "$ac_cv_func_poll" = "yes" ; then
+ SELECT_TYPE="poll"
+ AC_DEFINE(USE_POLL,1,[Use poll() for the IO loop])
+elif test "$ac_cv_func_select" = "yes" ; then
+ SELECT_TYPE="select"
+ AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop])
 else
         echo "Eep! Can't find poll, kqueue, epoll, or select!"
         echo "I'll try select and hope for the best."
Received on Thu Feb 19 2004 - 20:19:45 MST

This archive was generated by hypermail pre-2.1.9 : Mon Mar 01 2004 - 12:00:04 MST