… | |
… | |
115 | # else |
115 | # else |
116 | # undef EV_USE_EPOLL |
116 | # undef EV_USE_EPOLL |
117 | # define EV_USE_EPOLL 0 |
117 | # define EV_USE_EPOLL 0 |
118 | # endif |
118 | # endif |
119 | |
119 | |
|
|
120 | # if HAVE_LINUX_AIO_ABI_H |
|
|
121 | # ifndef EV_USE_LINUXAIO |
|
|
122 | # define EV_USE_LINUXAIO EV_FEATURE_BACKENDS |
|
|
123 | # endif |
|
|
124 | # else |
|
|
125 | # undef EV_USE_LINUXAIO |
|
|
126 | # define EV_USE_LINUXAIO 0 |
|
|
127 | # endif |
|
|
128 | |
120 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H |
129 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H |
121 | # ifndef EV_USE_KQUEUE |
130 | # ifndef EV_USE_KQUEUE |
122 | # define EV_USE_KQUEUE EV_FEATURE_BACKENDS |
131 | # define EV_USE_KQUEUE EV_FEATURE_BACKENDS |
123 | # endif |
132 | # endif |
124 | # else |
133 | # else |
… | |
… | |
316 | #ifndef EV_USE_PORT |
325 | #ifndef EV_USE_PORT |
317 | # define EV_USE_PORT 0 |
326 | # define EV_USE_PORT 0 |
318 | #endif |
327 | #endif |
319 | |
328 | |
320 | #ifndef EV_USE_LINUXAIO |
329 | #ifndef EV_USE_LINUXAIO |
|
|
330 | # if __linux /* libev currently assumes linux/aio_abi.h is always available on linux */ |
|
|
331 | # define EV_USE_LINUXAIO 1 |
|
|
332 | # else |
321 | # define EV_USE_LINUXAIO 0 |
333 | # define EV_USE_LINUXAIO 0 |
|
|
334 | # endif |
322 | #endif |
335 | #endif |
323 | |
336 | |
324 | #ifndef EV_USE_INOTIFY |
337 | #ifndef EV_USE_INOTIFY |
325 | # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 4)) |
338 | # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 4)) |
326 | # define EV_USE_INOTIFY EV_FEATURE_OS |
339 | # define EV_USE_INOTIFY EV_FEATURE_OS |
… | |
… | |
383 | /* aix's poll.h seems to cause lots of trouble */ |
396 | /* aix's poll.h seems to cause lots of trouble */ |
384 | #ifdef _AIX |
397 | #ifdef _AIX |
385 | /* AIX has a completely broken poll.h header */ |
398 | /* AIX has a completely broken poll.h header */ |
386 | # undef EV_USE_POLL |
399 | # undef EV_USE_POLL |
387 | # define EV_USE_POLL 0 |
400 | # define EV_USE_POLL 0 |
388 | #endif |
|
|
389 | |
|
|
390 | #if EV_USE_LINUXAIO |
|
|
391 | # include <linux/aio_abi.h> /* probably only needed for aio_context_t */ |
|
|
392 | #endif |
401 | #endif |
393 | |
402 | |
394 | /* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */ |
403 | /* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */ |
395 | /* which makes programs even slower. might work on other unices, too. */ |
404 | /* which makes programs even slower. might work on other unices, too. */ |
396 | #if EV_USE_CLOCK_SYSCALL |
405 | #if EV_USE_CLOCK_SYSCALL |
… | |
… | |
424 | |
433 | |
425 | #if !EV_USE_NANOSLEEP |
434 | #if !EV_USE_NANOSLEEP |
426 | /* hp-ux has it in sys/time.h, which we unconditionally include above */ |
435 | /* hp-ux has it in sys/time.h, which we unconditionally include above */ |
427 | # if !defined _WIN32 && !defined __hpux |
436 | # if !defined _WIN32 && !defined __hpux |
428 | # include <sys/select.h> |
437 | # include <sys/select.h> |
|
|
438 | # endif |
|
|
439 | #endif |
|
|
440 | |
|
|
441 | #if EV_USE_LINUXAIO |
|
|
442 | # include <sys/syscall.h> |
|
|
443 | # if !SYS_io_getevents || !EV_USE_EPOLL |
|
|
444 | # undef EV_USE_LINUXAIO |
|
|
445 | # define EV_USE_LINUXAIO 0 |
429 | # endif |
446 | # endif |
430 | #endif |
447 | #endif |
431 | |
448 | |
432 | #if EV_USE_INOTIFY |
449 | #if EV_USE_INOTIFY |
433 | # include <sys/statfs.h> |
450 | # include <sys/statfs.h> |
… | |
… | |
1586 | # include "ev_win32.c" |
1603 | # include "ev_win32.c" |
1587 | #endif |
1604 | #endif |
1588 | |
1605 | |
1589 | /*****************************************************************************/ |
1606 | /*****************************************************************************/ |
1590 | |
1607 | |
|
|
1608 | #if EV_USE_LINUXAIO |
|
|
1609 | # include <linux/aio_abi.h> /* probably only needed for aio_context_t */ |
|
|
1610 | #endif |
|
|
1611 | |
1591 | /* define a suitable floor function (only used by periodics atm) */ |
1612 | /* define a suitable floor function (only used by periodics atm) */ |
1592 | |
1613 | |
1593 | #if EV_USE_FLOOR |
1614 | #if EV_USE_FLOOR |
1594 | # include <math.h> |
1615 | # include <math.h> |
1595 | # define ev_floor(v) floor (v) |
1616 | # define ev_floor(v) floor (v) |
… | |
… | |
2712 | # include "ev_port.c" |
2733 | # include "ev_port.c" |
2713 | #endif |
2734 | #endif |
2714 | #if EV_USE_KQUEUE |
2735 | #if EV_USE_KQUEUE |
2715 | # include "ev_kqueue.c" |
2736 | # include "ev_kqueue.c" |
2716 | #endif |
2737 | #endif |
|
|
2738 | #if EV_USE_EPOLL |
|
|
2739 | # include "ev_epoll.c" |
|
|
2740 | #endif |
2717 | #if EV_USE_LINUXAIO |
2741 | #if EV_USE_LINUXAIO |
2718 | # include "ev_linuxaio.c" |
2742 | # include "ev_linuxaio.c" |
2719 | #endif |
|
|
2720 | #if EV_USE_EPOLL |
|
|
2721 | # include "ev_epoll.c" |
|
|
2722 | #endif |
2743 | #endif |
2723 | #if EV_USE_POLL |
2744 | #if EV_USE_POLL |
2724 | # include "ev_poll.c" |
2745 | # include "ev_poll.c" |
2725 | #endif |
2746 | #endif |
2726 | #if EV_USE_SELECT |
2747 | #if EV_USE_SELECT |
… | |
… | |
2784 | flags &= ~EVBACKEND_POLL; /* poll is based on kqueue from 10.5 onwards */ |
2805 | flags &= ~EVBACKEND_POLL; /* poll is based on kqueue from 10.5 onwards */ |
2785 | #endif |
2806 | #endif |
2786 | #ifdef __FreeBSD__ |
2807 | #ifdef __FreeBSD__ |
2787 | flags &= ~EVBACKEND_POLL; /* poll return value is unusable (http://forums.freebsd.org/archive/index.php/t-10270.html) */ |
2808 | flags &= ~EVBACKEND_POLL; /* poll return value is unusable (http://forums.freebsd.org/archive/index.php/t-10270.html) */ |
2788 | #endif |
2809 | #endif |
|
|
2810 | |
|
|
2811 | /* TODO: linuxaio is very experimental */ |
|
|
2812 | flags &= ~EVBACKEND_LINUXAIO; |
2789 | |
2813 | |
2790 | return flags; |
2814 | return flags; |
2791 | } |
2815 | } |
2792 | |
2816 | |
2793 | ecb_cold |
2817 | ecb_cold |