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.26 by root, Mon Nov 26 08:04:03 2007 UTC vs.
Revision 1.27 by root, Wed Nov 28 11:15:55 2007 UTC

34#include <sys/queue.h> 34#include <sys/queue.h>
35#include <sys/event.h> 35#include <sys/event.h>
36#include <string.h> 36#include <string.h>
37#include <errno.h> 37#include <errno.h>
38 38
39static void 39void inline_speed
40kqueue_change (EV_P_ int fd, int filter, int flags, int fflags) 40kqueue_change (EV_P_ int fd, int filter, int flags, int fflags)
41{ 41{
42 struct kevent *ke; 42 struct kevent *ke;
43 43
44 ++kqueue_changecnt; 44 ++kqueue_changecnt;
140 kqueue_eventmax = array_roundsize (struct kevent, kqueue_eventmax << 1); 140 kqueue_eventmax = array_roundsize (struct kevent, kqueue_eventmax << 1);
141 kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); 141 kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax);
142 } 142 }
143} 143}
144 144
145static int 145int inline_size
146kqueue_init (EV_P_ int flags) 146kqueue_init (EV_P_ int flags)
147{ 147{
148 struct kevent ch, ev; 148 struct kevent ch, ev;
149 149
150 /* Initalize the kernel queue */ 150 /* Initalize the kernel queue */
166 kqueue_changecnt = 0; 166 kqueue_changecnt = 0;
167 167
168 return EVBACKEND_KQUEUE; 168 return EVBACKEND_KQUEUE;
169} 169}
170 170
171static void 171void inline_size
172kqueue_destroy (EV_P) 172kqueue_destroy (EV_P)
173{ 173{
174 close (backend_fd);
175
176 ev_free (kqueue_events); 174 ev_free (kqueue_events);
177 ev_free (kqueue_changes); 175 ev_free (kqueue_changes);
178} 176}
179 177
180static void 178void inline_size
181kqueue_fork (EV_P) 179kqueue_fork (EV_P)
182{ 180{
183 close (backend_fd); 181 close (backend_fd);
184 182
185 while ((backend_fd = kqueue ()) < 0) 183 while ((backend_fd = kqueue ()) < 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines