ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev_kqueue.c
(Generate patch)

Comparing libev/ev_kqueue.c (file contents):
Revision 1.28 by root, Wed Dec 5 13:54:37 2007 UTC vs.
Revision 1.30 by root, Sun Dec 9 03:51:19 2007 UTC

90 ts.tv_sec = (time_t)timeout; 90 ts.tv_sec = (time_t)timeout;
91 ts.tv_nsec = (long)((timeout - (ev_tstamp)ts.tv_sec) * 1e9); 91 ts.tv_nsec = (long)((timeout - (ev_tstamp)ts.tv_sec) * 1e9);
92 res = kevent (backend_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts); 92 res = kevent (backend_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts);
93 kqueue_changecnt = 0; 93 kqueue_changecnt = 0;
94 94
95 if (res < 0) 95 if (expect_false (res < 0))
96 { 96 {
97 if (errno != EINTR) 97 if (errno != EINTR)
98 syserr ("(libev) kevent"); 98 syserr ("(libev) kevent");
99 99
100 return; 100 return;
151 if ((backend_fd = kqueue ()) < 0) 151 if ((backend_fd = kqueue ()) < 0)
152 return 0; 152 return 0;
153 153
154 fcntl (backend_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */ 154 fcntl (backend_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */
155 155
156 /* fudge *might* be zero from the documentation, but bsd docs are notoriously wrong */
157 backend_fudge = 1e-3; /* needed to compensate for kevent returning early */ 156 backend_fudge = 1e-3; /* needed to compensate for kevent returning early */
158 backend_modify = kqueue_modify; 157 backend_modify = kqueue_modify;
159 backend_poll = kqueue_poll; 158 backend_poll = kqueue_poll;
160 159
161 kqueue_eventmax = 64; /* initial number of events receivable per poll */ 160 kqueue_eventmax = 64; /* initial number of events receivable per poll */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines