… | |
… | |
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 | backend_fudge = 1e-3; /* needed to compensate for kevent returning early */ |
156 | backend_fudge = 0.; |
157 | backend_modify = kqueue_modify; |
157 | backend_modify = kqueue_modify; |
158 | backend_poll = kqueue_poll; |
158 | backend_poll = kqueue_poll; |
159 | |
159 | |
160 | kqueue_eventmax = 64; /* initial number of events receivable per poll */ |
160 | kqueue_eventmax = 64; /* initial number of events receivable per poll */ |
161 | kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); |
161 | kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); |