… | |
… | |
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 = 0.; |
164 | backend_fudge = 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); |