The unified diff between revisions [0b1b35ce..] and [14a5ae7c..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'src/comm_select.c'
#
#
# patch "src/comm_select.c"
# from [16d275ec06f5529b6ed8e6cd5387b17ecf02121e]
# to [4fdf649d1a0cb837d69227cf82d7a45bd0f86ba3]
#
============================================================
--- src/comm_select.c 16d275ec06f5529b6ed8e6cd5387b17ecf02121e
+++ src/comm_select.c 4fdf649d1a0cb837d69227cf82d7a45bd0f86ba3
@@ -32,11 +32,15 @@
*
*/
+#define HAVE_SELECT_OR_POLL (HAVE_POLL && (!HAVE_KQUEUE) && (!HAVE_EPOLL))
+#define HAVE_SELECT (!HAVE_POLL && !HAVE_EPOLL && !HAVE_KQUEUE)
+#define HAVE_EVENTNETIO (HAVE_KQUEUE || HAVE_EPOLL)
+
#include "squid.h"
static int MAX_POLL_TIME = 1000; /* see also comm_quick_poll_required() */
-#if !HAVE_EPOLL
+#if HAVE_SELECT_OR_POLL
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
@@ -48,7 +52,7 @@ static int MAX_POLL_TIME = 1000; /* see
#define FD_MASK_BITS (FD_MASK_BYTES*NBBY)
/* STATIC */
-#if !HAVE_POLL
+#if HAVE_SELECT
static int examine_select(fd_set *, fd_set *);
#endif
static int fdIsHttp(int fd);
@@ -65,7 +69,7 @@ static void comm_select_dns_incoming(voi
static void comm_select_dns_incoming(void);
#endif
-#if !HAVE_POLL
+#if HAVE_SELECT
static struct timeval zero_tv;
#endif
static fd_set global_readfds;
@@ -936,7 +940,7 @@ comm_select_init(void)
void
comm_select_init(void)
{
-#if !HAVE_POLL
+#if HAVE_SELECT
zero_tv.tv_sec = 0;
zero_tv.tv_usec = 0;
#endif
@@ -948,7 +952,7 @@ comm_select_init(void)
nreadfds = nwritefds = 0;
}
-#if !HAVE_POLL
+#if HAVE_SELECT
/*
* examine_select - debug routine.
*
@@ -1072,7 +1076,7 @@ commUpdateWriteBits(int fd, PF * handler
}
}
-#else /* HAVE_EPOLL */
+#elif HAVE_EPOLL /* HAVE_EPOLL */
/* epoll structs */
static int kdpfd;
static struct epoll_event *pevents;
@@ -1469,7 +1473,12 @@ WRITE_EVENT:
debug(5, 8) ("comm_epoll: time out: %ld.\n", (long int) squid_curtime);
return COMM_TIMEOUT;
}
-#endif /* HAVE_EPOLL */
+#elif HAVE_KQUEUE
+/* Yes, this is a hack for now! - [ahc] */
+#include "comm_kqueue.c"
+#else
+#error HAVE_KQUEUE, HAVE_EPOLL, HAVE_POLL (and no select!) wasn't defined!
+#endif
static int
commDeferRead(int fd)