------------------------------------------------------------ revno: 12437 revision-id: squid3@treenet.co.nz-20130102040134-1xaa56m5g7sajw1x parent: squid3@treenet.co.nz-20130102034455-tot50otj3kbi4oxt fixes bug(s): http://bugs.squid-cache.org/show_bug.cgi?id=3716 committer: Amos Jeffries branch nick: 3.3 timestamp: Tue 2013-01-01 21:01:34 -0700 message: kqueue: update status from experimental to fully available net I/O method kqueue has been in use on FreeBSD and maybe others for some time now and has less bugs than epoll. So the issues on record should not be held against it. The attached patch adds auto-detection for the kqueue dependencies and enables it by default when it can build. Unfortunately due to the dependencies we cannot add it to maximus layer for force-enable, but the default layer will test it on FreeBSD at least. It is still less preferred than epoll(), but more than select() and poll(). Also fixes bug 3716 "build error on FreeBSD in kqueue" ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20130102040134-1xaa56m5g7sajw1x # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: 754b04efea46e289181e35f79dbdeb04882f05a9 # timestamp: 2013-01-02 04:08:44 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20130102034455-\ # tot50otj3kbi4oxt # # Begin patch === modified file 'configure.ac' --- configure.ac 2012-12-27 02:31:36 +0000 +++ configure.ac 2013-01-02 04:01:34 +0000 @@ -1313,18 +1313,29 @@ ]) AC_MSG_NOTICE([enabling poll syscall for net I/O: ${enable_poll:=auto}]) -# kqueue support is still experiemntal and unstable. Not enabled by default. AC_ARG_ENABLE(kqueue, - AS_HELP_STRING([--enable-kqueue], - [Enable kqueue(2) support (experimental).]), [ + AS_HELP_STRING([--disable-kqueue], + [Disable kqueue(2) support.]), [ SQUID_YESNO($enableval,[--enable-kqueue takes no extra argument]) ]) -if test "x${enable_kqueue:=no}" = "xyes" ; then - AC_CHECK_HEADERS([sys/event.h],[], - [ AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) ]) - squid_opt_io_loop_engine="kqueue" +if test "x${enable_kqueue:=auto}" != "xno" ; then + AC_CHECK_HEADERS([sys/event.h],[],[ + if test "x${enable_kqueue}" = "xyes" ; then + AC_MSG_ERROR([kqueue support requires sys/event.h header file.]) + fi + ]) + AC_CHECK_FUNCS(kqueue,[],[ + if test "x${enable_kqueue}" = "xyes" ; then + AC_MSG_ERROR([kqueue support missing in libc library.]) + fi + ]) + if test "x$ac_cv_func_kqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes" ; then + squid_opt_io_loop_engine="kqueue" + else + enable_kqueue="no" + fi fi -AC_MSG_NOTICE([enabling kqueue for net I/O: $enable_kqueue]) +AC_MSG_NOTICE([enabling kqueue for net I/O: ${enable_kqueue:=auto}]) dnl Enable epoll() AC_ARG_ENABLE(epoll, @@ -3160,7 +3171,6 @@ glob \ htobe16 \ htole16 \ - kqueue\ lrand48 \ mallinfo \ mallocblksize \ @@ -3228,7 +3238,7 @@ AC_MSG_NOTICE([choosing user-specified net I/O API $squid_opt_io_loop_engine]) elif test "x$enable_epoll" != "xno" -a "x$squid_cv_epoll_works" = "xyes" ; then squid_opt_io_loop_engine="epoll" -elif test "x$enable_kqueue" != "xno" -a "x$ac_cv_func_kqueue" = "xyes" ; then +elif test "x$enable_kqueue" != "xno" ; then squid_opt_io_loop_engine="kqueue" elif test "x$enable_devpoll" != "xno" ; then squid_opt_io_loop_engine="devpoll" === modified file 'src/comm/ModKqueue.cc' --- src/comm/ModKqueue.cc 2012-09-01 14:38:36 +0000 +++ src/comm/ModKqueue.cc 2013-01-02 04:01:34 +0000 @@ -55,6 +55,7 @@ #if USE_KQUEUE #include "comm/Loops.h" #include "fde.h" +#include "globals.h" #include "SquidTime.h" #include "StatCounters.h" #include "Store.h"