ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.126 by root, Sun Nov 18 01:25:23 2007 UTC vs.
Revision 1.128 by root, Thu Nov 22 12:28:27 2007 UTC

50# ifndef EV_USE_REALTIME 50# ifndef EV_USE_REALTIME
51# define EV_USE_REALTIME 0 51# define EV_USE_REALTIME 0
52# endif 52# endif
53# endif 53# endif
54 54
55# if HAVE_SELECT && HAVE_SYS_SELECT_H && !defined (EV_USE_SELECT) 55# ifndef EV_USE_SELECT
56# if HAVE_SELECT && HAVE_SYS_SELECT_H
56# define EV_USE_SELECT 1 57# define EV_USE_SELECT 1
57# else 58# else
58# define EV_USE_SELECT 0 59# define EV_USE_SELECT 0
60# endif
59# endif 61# endif
60 62
61# if HAVE_POLL && HAVE_POLL_H && !defined (EV_USE_POLL) 63# ifndef EV_USE_POLL
64# if HAVE_POLL && HAVE_POLL_H
62# define EV_USE_POLL 1 65# define EV_USE_POLL 1
63# else 66# else
64# define EV_USE_POLL 0 67# define EV_USE_POLL 0
68# endif
65# endif 69# endif
66 70
67# 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
68# define EV_USE_EPOLL 1 73# define EV_USE_EPOLL 1
69# else 74# else
70# define EV_USE_EPOLL 0 75# define EV_USE_EPOLL 0
76# endif
71# endif 77# endif
72 78
79# ifndef EV_USE_KQUEUE
73# 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
74# define EV_USE_KQUEUE 1 81# define EV_USE_KQUEUE 1
75# else 82# else
76# define EV_USE_KQUEUE 0 83# define EV_USE_KQUEUE 0
84# endif
77# endif 85# endif
78 86
79# if HAVE_PORT_H && HAVE_PORT_CREATE && !defined (EV_USE_PORT) 87# ifndef EV_USE_PORT
88# if HAVE_PORT_H && HAVE_PORT_CREATE
80# define EV_USE_PORT 1 89# define EV_USE_PORT 1
81# else 90# else
82# define EV_USE_PORT 0 91# define EV_USE_PORT 0
92# endif
83# endif 93# endif
84 94
85#endif 95#endif
86 96
87#include <math.h> 97#include <math.h>
798 ev_rt_now = ev_time (); 808 ev_rt_now = ev_time ();
799 mn_now = get_clock (); 809 mn_now = get_clock ();
800 now_floor = mn_now; 810 now_floor = mn_now;
801 rtmn_diff = ev_rt_now - mn_now; 811 rtmn_diff = ev_rt_now - mn_now;
802 812
803 if (!(flags & EVFLAG_NOENV) && !enable_secure () && getenv ("LIBEV_FLAGS")) 813 if (!(flags & EVFLAG_NOENV)
814 && !enable_secure ()
815 && getenv ("LIBEV_FLAGS"))
804 flags = atoi (getenv ("LIBEV_FLAGS")); 816 flags = atoi (getenv ("LIBEV_FLAGS"));
805 817
806 if (!(flags & 0x0000ffff)) 818 if (!(flags & EVMETHOD_ALL))
807 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 }
808 827
809 method = 0; 828 method = 0;
810#if EV_USE_PORT 829#if EV_USE_PORT
811 if (!method && (flags & EVMETHOD_PORT )) method = port_init (EV_A_ flags); 830 if (!method && (flags & EVMETHOD_PORT )) method = port_init (EV_A_ flags);
812#endif 831#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines