… | |
… | |
159 | if ((backend_fd = kqueue ()) < 0) |
159 | if ((backend_fd = kqueue ()) < 0) |
160 | return 0; |
160 | return 0; |
161 | |
161 | |
162 | 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 */ |
163 | |
163 | |
164 | backend_fudge = 1e-9; /* apparently, they did the right thing in freebsd */ |
164 | backend_mintime = 1e-9; /* apparently, they did the right thing in freebsd */ |
165 | backend_modify = kqueue_modify; |
165 | backend_modify = kqueue_modify; |
166 | backend_poll = kqueue_poll; |
166 | backend_poll = kqueue_poll; |
167 | |
167 | |
168 | kqueue_eventmax = 64; /* initial number of events receivable per poll */ |
168 | kqueue_eventmax = 64; /* initial number of events receivable per poll */ |
169 | kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); |
169 | kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); |
170 | |
170 | |
171 | kqueue_changes = 0; |
171 | kqueue_changes = 0; |
… | |
… | |
194 | |
194 | |
195 | /* re-register interest in fds */ |
195 | /* re-register interest in fds */ |
196 | fd_rearm_all (EV_A); |
196 | fd_rearm_all (EV_A); |
197 | } |
197 | } |
198 | |
198 | |
|
|
199 | /* sys/event.h defines EV_ERROR */ |
|
|
200 | #undef EV_ERROR |
|
|
201 | |