… | |
… | |
58 | |
58 | |
59 | #ifndef EV_USE_SELECT |
59 | #ifndef EV_USE_SELECT |
60 | # define EV_USE_SELECT 1 |
60 | # define EV_USE_SELECT 1 |
61 | #endif |
61 | #endif |
62 | |
62 | |
63 | #ifndef EV_USEV_POLL |
63 | #ifndef EV_USE_POLL |
64 | # define EV_USEV_POLL 0 /* poll is usually slower than select, and not as well tested */ |
64 | # define EV_USE_POLL 0 /* poll is usually slower than select, and not as well tested */ |
65 | #endif |
65 | #endif |
66 | |
66 | |
67 | #ifndef EV_USE_EPOLL |
67 | #ifndef EV_USE_EPOLL |
68 | # define EV_USE_EPOLL 0 |
68 | # define EV_USE_EPOLL 0 |
69 | #endif |
69 | #endif |
… | |
… | |
409 | static ANSIG *signals; |
409 | static ANSIG *signals; |
410 | static int signalmax; |
410 | static int signalmax; |
411 | |
411 | |
412 | static int sigpipe [2]; |
412 | static int sigpipe [2]; |
413 | static sig_atomic_t volatile gotsig; |
413 | static sig_atomic_t volatile gotsig; |
|
|
414 | static struct ev_io sigev; |
414 | |
415 | |
415 | static void |
416 | static void |
416 | signals_init (ANSIG *base, int count) |
417 | signals_init (ANSIG *base, int count) |
417 | { |
418 | { |
418 | while (count--) |
419 | while (count--) |
… | |
… | |
475 | } |
476 | } |
476 | |
477 | |
477 | /*****************************************************************************/ |
478 | /*****************************************************************************/ |
478 | |
479 | |
479 | #ifndef WIN32 |
480 | #ifndef WIN32 |
|
|
481 | |
|
|
482 | static struct ev_child *childs [PID_HASHSIZE]; |
|
|
483 | static struct ev_signal childev; |
480 | |
484 | |
481 | #ifndef WCONTINUED |
485 | #ifndef WCONTINUED |
482 | # define WCONTINUED 0 |
486 | # define WCONTINUED 0 |
483 | #endif |
487 | #endif |
484 | |
488 | |
… | |
… | |
520 | # include "ev_kqueue.c" |
524 | # include "ev_kqueue.c" |
521 | #endif |
525 | #endif |
522 | #if EV_USE_EPOLL |
526 | #if EV_USE_EPOLL |
523 | # include "ev_epoll.c" |
527 | # include "ev_epoll.c" |
524 | #endif |
528 | #endif |
525 | #if EV_USEV_POLL |
529 | #if EV_USE_POLL |
526 | # include "ev_poll.c" |
530 | # include "ev_poll.c" |
527 | #endif |
531 | #endif |
528 | #if EV_USE_SELECT |
532 | #if EV_USE_SELECT |
529 | # include "ev_select.c" |
533 | # include "ev_select.c" |
530 | #endif |
534 | #endif |
… | |
… | |
588 | if (!method && (methods & EVMETHOD_KQUEUE)) method = kqueue_init (EV_A_ methods); |
592 | if (!method && (methods & EVMETHOD_KQUEUE)) method = kqueue_init (EV_A_ methods); |
589 | #endif |
593 | #endif |
590 | #if EV_USE_EPOLL |
594 | #if EV_USE_EPOLL |
591 | if (!method && (methods & EVMETHOD_EPOLL )) method = epoll_init (EV_A_ methods); |
595 | if (!method && (methods & EVMETHOD_EPOLL )) method = epoll_init (EV_A_ methods); |
592 | #endif |
596 | #endif |
593 | #if EV_USEV_POLL |
597 | #if EV_USE_POLL |
594 | if (!method && (methods & EVMETHOD_POLL )) method = poll_init (EV_A_ methods); |
598 | if (!method && (methods & EVMETHOD_POLL )) method = poll_init (EV_A_ methods); |
595 | #endif |
599 | #endif |
596 | #if EV_USE_SELECT |
600 | #if EV_USE_SELECT |
597 | if (!method && (methods & EVMETHOD_SELECT)) method = select_init (EV_A_ methods); |
601 | if (!method && (methods & EVMETHOD_SELECT)) method = select_init (EV_A_ methods); |
598 | #endif |
602 | #endif |
… | |
… | |
606 | if (method == EVMETHOD_KQUEUE) kqueue_destroy (EV_A); |
610 | if (method == EVMETHOD_KQUEUE) kqueue_destroy (EV_A); |
607 | #endif |
611 | #endif |
608 | #if EV_USE_EPOLL |
612 | #if EV_USE_EPOLL |
609 | if (method == EVMETHOD_EPOLL ) epoll_destroy (EV_A); |
613 | if (method == EVMETHOD_EPOLL ) epoll_destroy (EV_A); |
610 | #endif |
614 | #endif |
611 | #if EV_USEV_POLL |
615 | #if EV_USE_POLL |
612 | if (method == EVMETHOD_POLL ) poll_destroy (EV_A); |
616 | if (method == EVMETHOD_POLL ) poll_destroy (EV_A); |
613 | #endif |
617 | #endif |
614 | #if EV_USE_SELECT |
618 | #if EV_USE_SELECT |
615 | if (method == EVMETHOD_SELECT) select_destroy (EV_A); |
619 | if (method == EVMETHOD_SELECT) select_destroy (EV_A); |
616 | #endif |
620 | #endif |