From 079ffff0acc5dad3ef0389e25df1e59ce12f6cb5 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 24 Nov 2009 06:37:23 +0000 Subject: *** empty log message *** --- ev.pod | 3 +++ ev_epoll.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ev.pod b/ev.pod index 4e34827..fa6d7b0 100644 --- a/ev.pod +++ b/ev.pod @@ -413,6 +413,9 @@ C to C. =item C (value 4, Linux) +Use the linux-specific epoll(7) interface (for both pre- and post-2.6.9 +kernels). + For few fds, this backend is a bit little slower than poll and select, but it scales phenomenally better. While poll and select usually scale like O(total_fds) where n is the total number of fds (or the highest fd), diff --git a/ev_epoll.c b/ev_epoll.c index 04acd98..f7e3d60 100644 --- a/ev_epoll.c +++ b/ev_epoll.c @@ -161,6 +161,8 @@ epoll_poll (EV_P_ ev_tstamp timeout) ev->events = (want & EV_READ ? EPOLLIN : 0) | (want & EV_WRITE ? EPOLLOUT : 0); + /* pre-2.6.9 kernels require a non-null pointer with EPOLL_CTL_DEL, */ + /* which is fortunately easy to do for us. */ if (epoll_ctl (backend_fd, want ? EPOLL_CTL_MOD : EPOLL_CTL_DEL, fd, ev)) { postfork = 1; /* an error occured, recreate kernel state */ -- cgit v1.2.3