… | |
… | |
39 | #include <assert.h> |
39 | #include <assert.h> |
40 | #include <errno.h> |
40 | #include <errno.h> |
41 | #include <sys/time.h> |
41 | #include <sys/time.h> |
42 | #include <time.h> |
42 | #include <time.h> |
43 | |
43 | |
44 | #define HAVE_EPOLL 1 |
|
|
45 | |
|
|
46 | #ifndef HAVE_MONOTONIC |
44 | #ifndef HAVE_MONOTONIC |
47 | # ifdef CLOCK_MONOTONIC |
45 | # ifdef CLOCK_MONOTONIC |
48 | # define HAVE_MONOTONIC 1 |
46 | # define HAVE_MONOTONIC 1 |
49 | # endif |
47 | # endif |
50 | #endif |
48 | #endif |
… | |
… | |
188 | |
186 | |
189 | for (i = 0; i < eventcnt; ++i) |
187 | for (i = 0; i < eventcnt; ++i) |
190 | event (events [i], type); |
188 | event (events [i], type); |
191 | } |
189 | } |
192 | |
190 | |
|
|
191 | /* called on EBADF to verify fds */ |
|
|
192 | static void |
|
|
193 | fd_recheck () |
|
|
194 | { |
|
|
195 | int fd; |
|
|
196 | |
|
|
197 | for (fd = 0; fd < anfdmax; ++fd) |
|
|
198 | if (anfds [fd].wev) |
|
|
199 | if (fcntl (fd, F_GETFD) == -1 && errno == EBADF) |
|
|
200 | while (anfds [fd].head) |
|
|
201 | evio_stop (anfds [fd].head); |
|
|
202 | } |
|
|
203 | |
193 | /*****************************************************************************/ |
204 | /*****************************************************************************/ |
194 | |
205 | |
195 | static struct ev_timer **timers; |
206 | static struct ev_timer **timers; |
196 | static int timermax, timercnt; |
207 | static int timermax, timercnt; |
197 | |
208 | |