… | |
… | |
41 | # define EV_USE_MONOTONIC 1 |
41 | # define EV_USE_MONOTONIC 1 |
42 | # endif |
42 | # endif |
43 | # ifndef EV_USE_REALTIME |
43 | # ifndef EV_USE_REALTIME |
44 | # define EV_USE_REALTIME 1 |
44 | # define EV_USE_REALTIME 1 |
45 | # endif |
45 | # endif |
|
|
46 | # else |
|
|
47 | # ifndef EV_USE_MONOTONIC |
|
|
48 | # define EV_USE_MONOTONIC 0 |
|
|
49 | # endif |
|
|
50 | # ifndef EV_USE_REALTIME |
|
|
51 | # define EV_USE_REALTIME 0 |
|
|
52 | # endif |
46 | # endif |
53 | # endif |
47 | |
54 | |
48 | # if HAVE_SELECT && HAVE_SYS_SELECT_H && !defined (EV_USE_SELECT) |
55 | # ifndef EV_USE_SELECT |
|
|
56 | # if HAVE_SELECT && HAVE_SYS_SELECT_H |
49 | # define EV_USE_SELECT 1 |
57 | # define EV_USE_SELECT 1 |
|
|
58 | # else |
|
|
59 | # define EV_USE_SELECT 0 |
|
|
60 | # endif |
50 | # endif |
61 | # endif |
51 | |
62 | |
52 | # if HAVE_POLL && HAVE_POLL_H && !defined (EV_USE_POLL) |
63 | # ifndef EV_USE_POLL |
|
|
64 | # if HAVE_POLL && HAVE_POLL_H |
53 | # define EV_USE_POLL 1 |
65 | # define EV_USE_POLL 1 |
|
|
66 | # else |
|
|
67 | # define EV_USE_POLL 0 |
|
|
68 | # endif |
54 | # endif |
69 | # endif |
55 | |
70 | |
56 | # if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H && !defined (EV_USE_EPOLL) |
71 | # ifndef EV_USE_EPOLL |
|
|
72 | # if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H |
57 | # define EV_USE_EPOLL 1 |
73 | # define EV_USE_EPOLL 1 |
|
|
74 | # else |
|
|
75 | # define EV_USE_EPOLL 0 |
|
|
76 | # endif |
58 | # endif |
77 | # endif |
59 | |
78 | |
|
|
79 | # ifndef EV_USE_KQUEUE |
60 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H && !defined (EV_USE_KQUEUE) |
80 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H |
61 | # define EV_USE_KQUEUE 1 |
81 | # define EV_USE_KQUEUE 1 |
|
|
82 | # else |
|
|
83 | # define EV_USE_KQUEUE 0 |
|
|
84 | # endif |
62 | # endif |
85 | # endif |
63 | |
86 | |
64 | # if HAVE_PORT_H && HAVE_PORT_CREATE && !defined (EV_USE_PORT) |
87 | # ifndef EV_USE_PORT |
|
|
88 | # if HAVE_PORT_H && HAVE_PORT_CREATE |
65 | # define EV_USE_PORT 1 |
89 | # define EV_USE_PORT 1 |
|
|
90 | # else |
|
|
91 | # define EV_USE_PORT 0 |
|
|
92 | # endif |
66 | # endif |
93 | # endif |
67 | |
94 | |
68 | #endif |
95 | #endif |
69 | |
96 | |
70 | #include <math.h> |
97 | #include <math.h> |
… | |
… | |
781 | ev_rt_now = ev_time (); |
808 | ev_rt_now = ev_time (); |
782 | mn_now = get_clock (); |
809 | mn_now = get_clock (); |
783 | now_floor = mn_now; |
810 | now_floor = mn_now; |
784 | rtmn_diff = ev_rt_now - mn_now; |
811 | rtmn_diff = ev_rt_now - mn_now; |
785 | |
812 | |
786 | if (!(flags & EVFLAG_NOENV) && !enable_secure () && getenv ("LIBEV_FLAGS")) |
813 | if (!(flags & EVFLAG_NOENV) |
|
|
814 | && !enable_secure () |
|
|
815 | && getenv ("LIBEV_FLAGS")) |
787 | flags = atoi (getenv ("LIBEV_FLAGS")); |
816 | flags = atoi (getenv ("LIBEV_FLAGS")); |
788 | |
817 | |
789 | if (!(flags & 0x0000ffff)) |
818 | if (!(flags & EVMETHOD_ALL)) |
790 | flags |= 0x0000ffff; |
819 | { |
|
|
820 | flags |= EVMETHOD_ALL; |
|
|
821 | #if EV_USE_KQUEUE && !defined (__NetBSD__) |
|
|
822 | /* kqueue is borked on everything but netbsd apparently */ |
|
|
823 | /* it usually doesn't work correctly on anything but sockets and pipes */ |
|
|
824 | flags &= ~EVMETHOD_KQUEUE; |
|
|
825 | #endif |
|
|
826 | } |
791 | |
827 | |
792 | method = 0; |
828 | method = 0; |
793 | #if EV_USE_PORT |
829 | #if EV_USE_PORT |
794 | if (!method && (flags & EVMETHOD_PORT )) method = port_init (EV_A_ flags); |
830 | if (!method && (flags & EVMETHOD_PORT )) method = port_init (EV_A_ flags); |
795 | #endif |
831 | #endif |