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.44 by sf-exg, Sat Apr 3 22:33:24 2010 UTC vs.
Revision 1.46 by root, Fri Oct 15 22:44:41 2010 UTC

95 kqueue_eventmax = array_nextsize (sizeof (struct kevent), kqueue_eventmax, kqueue_changecnt); 95 kqueue_eventmax = array_nextsize (sizeof (struct kevent), kqueue_eventmax, kqueue_changecnt);
96 kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); 96 kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax);
97 } 97 }
98 98
99 EV_RELEASE_CB; 99 EV_RELEASE_CB;
100 ts.tv_sec = (time_t)timeout; 100 EV_SET_TV (tv, timeout);
101 ts.tv_nsec = (long)((timeout - (ev_tstamp)ts.tv_sec) * 1e9);
102 res = kevent (backend_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts); 101 res = kevent (backend_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts);
103 EV_ACQUIRE_CB; 102 EV_ACQUIRE_CB;
104 kqueue_changecnt = 0; 103 kqueue_changecnt = 0;
105 104
106 if (expect_false (res < 0)) 105 if (expect_false (res < 0))
154} 153}
155 154
156int inline_size 155int inline_size
157kqueue_init (EV_P_ int flags) 156kqueue_init (EV_P_ int flags)
158{ 157{
159 /* Initalize the kernel queue */ 158 /* Initialize the kernel queue */
160 if ((backend_fd = kqueue ()) < 0) 159 if ((backend_fd = kqueue ()) < 0)
161 return 0; 160 return 0;
162 161
163 fcntl (backend_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */ 162 fcntl (backend_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */
164 163

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines