Browse Source

Upgrade libev to 4.4

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
470ebe249f
  1. 9
      deps/libev/Changes
  2. 2
      deps/libev/configure.ac
  3. 41
      deps/libev/ev.3
  4. 47
      deps/libev/ev.c
  5. 4
      deps/libev/ev.h
  6. 39
      deps/libev/ev.pod
  7. 2
      deps/libev/ev_epoll.c
  8. 4
      deps/libev/ev_poll.c
  9. 2
      deps/libev/ev_port.c
  10. 5
      deps/libev/ev_select.c
  11. 4
      deps/libev/libev.m4

9
deps/libev/Changes

@ -1,5 +1,14 @@
Revision history for libev, a high-performance and full-featured event loop. Revision history for libev, a high-performance and full-featured event loop.
4.04 Wed Feb 16 09:01:51 CET 2011
- fix two problems in the native win32 backend, where reuse of fd's
with different underlying handles caused handles not to be removed
or added to the select set (analyzed and tested by Bert Belder).
- do no rely on ceil() in ev_e?poll.c.
- backport libev to HP-UX versions before 11 v3.
- configure did not detect nanosleep and clock_gettime properly when
they are available in the libc (as opposed to -lrt).
4.03 Tue Jan 11 14:37:25 CET 2011 4.03 Tue Jan 11 14:37:25 CET 2011
- officially support polling files with all backends. - officially support polling files with all backends.
- support files, /dev/zero etc. the same way as select in the epoll - support files, /dev/zero etc. the same way as select in the epoll

2
deps/libev/configure.ac

@ -1,7 +1,7 @@
AC_INIT AC_INIT
AC_CONFIG_SRCDIR([ev_epoll.c]) AC_CONFIG_SRCDIR([ev_epoll.c])
AM_INIT_AUTOMAKE(libev,4.03) dnl also update ev.h! AM_INIT_AUTOMAKE(libev,4.04) dnl also update ev.h!
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE AM_MAINTAINER_MODE

41
deps/libev/ev.3

@ -124,7 +124,7 @@
.\" ======================================================================== .\" ========================================================================
.\" .\"
.IX Title "LIBEV 3" .IX Title "LIBEV 3"
.TH LIBEV 3 "2011-01-11" "libev-4.03" "libev - high performance full featured event loop" .TH LIBEV 3 "2011-02-16" "libev-4.04" "libev - high performance full featured event loop"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents. .\" way too many mistakes in technical documents.
.if n .ad l .if n .ad l
@ -191,7 +191,7 @@ libev \- a high performance full\-featured event loop written in C
\& // now wait for events to arrive \& // now wait for events to arrive
\& ev_run (loop, 0); \& ev_run (loop, 0);
\& \&
\& // unloop was called, so exit \& // break was called, so exit
\& return 0; \& return 0;
\& } \& }
.Ve .Ve
@ -562,6 +562,9 @@ This behaviour is useful when you want to do your own signal handling, or
want to handle signals only in specific threads and want to avoid libev want to handle signals only in specific threads and want to avoid libev
unblocking the signals. unblocking the signals.
.Sp .Sp
It's also required by \s-1POSIX\s0 in a threaded program, as libev calls
\&\f(CW\*(C`sigprocmask\*(C'\fR, whose behaviour is officially unspecified.
.Sp
This flag's behaviour will become the default in future versions of libev. This flag's behaviour will become the default in future versions of libev.
.ie n .IP """EVBACKEND_SELECT"" (value 1, portable select backend)" 4 .ie n .IP """EVBACKEND_SELECT"" (value 1, portable select backend)" 4
.el .IP "\f(CWEVBACKEND_SELECT\fR (value 1, portable select backend)" 4 .el .IP "\f(CWEVBACKEND_SELECT\fR (value 1, portable select backend)" 4
@ -987,7 +990,7 @@ anymore.
\& ... queue jobs here, make sure they register event watchers as long \& ... queue jobs here, make sure they register event watchers as long
\& ... as they still have work to do (even an idle watcher will do..) \& ... as they still have work to do (even an idle watcher will do..)
\& ev_run (my_loop, 0); \& ev_run (my_loop, 0);
\& ... jobs done or somebody called unloop. yeah! \& ... jobs done or somebody called break. yeah!
.Ve .Ve
.IP "ev_break (loop, how)" 4 .IP "ev_break (loop, how)" 4
.IX Item "ev_break (loop, how)" .IX Item "ev_break (loop, how)"
@ -1492,8 +1495,10 @@ Before a watcher can be registered with the event looop it has to be
initialised. This can be done with a call to \f(CW\*(C`ev_TYPE_init\*(C'\fR, or calls to initialised. This can be done with a call to \f(CW\*(C`ev_TYPE_init\*(C'\fR, or calls to
\&\f(CW\*(C`ev_init\*(C'\fR followed by the watcher-specific \f(CW\*(C`ev_TYPE_set\*(C'\fR function. \&\f(CW\*(C`ev_init\*(C'\fR followed by the watcher-specific \f(CW\*(C`ev_TYPE_set\*(C'\fR function.
.Sp .Sp
In this state it is simply some block of memory that is suitable for use In this state it is simply some block of memory that is suitable for
in an event loop. It can be moved around, freed, reused etc. at will. use in an event loop. It can be moved around, freed, reused etc. at
will \- as long as you either keep the memory contents intact, or call
\&\f(CW\*(C`ev_TYPE_init\*(C'\fR again.
.IP "started/running/active" 4 .IP "started/running/active" 4
.IX Item "started/running/active" .IX Item "started/running/active"
Once a watcher has been started with a call to \f(CW\*(C`ev_TYPE_start\*(C'\fR it becomes Once a watcher has been started with a call to \f(CW\*(C`ev_TYPE_start\*(C'\fR it becomes
@ -1528,8 +1533,9 @@ of whether it was active or not, so stopping a watcher explicitly before
freeing it is often a good idea. freeing it is often a good idea.
.Sp .Sp
While stopped (and not pending) the watcher is essentially in the While stopped (and not pending) the watcher is essentially in the
initialised state, that is it can be reused, moved, modified in any way initialised state, that is, it can be reused, moved, modified in any way
you wish. you wish (but when you trash the memory block, you need to \f(CW\*(C`ev_TYPE_init\*(C'\fR
it again).
.SS "\s-1WATCHER\s0 \s-1PRIORITY\s0 \s-1MODELS\s0" .SS "\s-1WATCHER\s0 \s-1PRIORITY\s0 \s-1MODELS\s0"
.IX Subsection "WATCHER PRIORITY MODELS" .IX Subsection "WATCHER PRIORITY MODELS"
Many event loops support \fIwatcher priorities\fR, which are usually small Many event loops support \fIwatcher priorities\fR, which are usually small
@ -2431,7 +2437,8 @@ and unblock them in an \f(CW\*(C`ev_prepare\*(C'\fR watcher.
Both the signal mask (\f(CW\*(C`sigprocmask\*(C'\fR) and the signal disposition Both the signal mask (\f(CW\*(C`sigprocmask\*(C'\fR) and the signal disposition
(\f(CW\*(C`sigaction\*(C'\fR) are unspecified after starting a signal watcher (and after (\f(CW\*(C`sigaction\*(C'\fR) are unspecified after starting a signal watcher (and after
stopping it again), that is, libev might or might not block the signal, stopping it again), that is, libev might or might not block the signal,
and might or might not set or restore the installed signal handler. and might or might not set or restore the installed signal handler (but
see \f(CW\*(C`EVFLAG_NOSIGMASK\*(C'\fR).
.PP .PP
While this does not matter for the signal disposition (libev never While this does not matter for the signal disposition (libev never
sets signals to \f(CW\*(C`SIG_IGN\*(C'\fR, so handlers will be reset to \f(CW\*(C`SIG_DFL\*(C'\fR on sets signals to \f(CW\*(C`SIG_IGN\*(C'\fR, so handlers will be reset to \f(CW\*(C`SIG_DFL\*(C'\fR on
@ -3309,7 +3316,7 @@ cleanup functions are called.
.ie n .SS """ev_async"" \- how to wake up an event loop" .ie n .SS """ev_async"" \- how to wake up an event loop"
.el .SS "\f(CWev_async\fP \- how to wake up an event loop" .el .SS "\f(CWev_async\fP \- how to wake up an event loop"
.IX Subsection "ev_async - how to wake up an event loop" .IX Subsection "ev_async - how to wake up an event loop"
In general, you cannot use an \f(CW\*(C`ev_run\*(C'\fR from multiple threads or other In general, you cannot use an \f(CW\*(C`ev_loop\*(C'\fR from multiple threads or other
asynchronous sources such as signal handlers (as opposed to multiple event asynchronous sources such as signal handlers (as opposed to multiple event
loops \- those are of course safe to use in different threads). loops \- those are of course safe to use in different threads).
.PP .PP
@ -3424,10 +3431,12 @@ trust me.
.IP "ev_async_send (loop, ev_async *)" 4 .IP "ev_async_send (loop, ev_async *)" 4
.IX Item "ev_async_send (loop, ev_async *)" .IX Item "ev_async_send (loop, ev_async *)"
Sends/signals/activates the given \f(CW\*(C`ev_async\*(C'\fR watcher, that is, feeds Sends/signals/activates the given \f(CW\*(C`ev_async\*(C'\fR watcher, that is, feeds
an \f(CW\*(C`EV_ASYNC\*(C'\fR event on the watcher into the event loop. Unlike an \f(CW\*(C`EV_ASYNC\*(C'\fR event on the watcher into the event loop, and instantly
\&\f(CW\*(C`ev_feed_event\*(C'\fR, this call is safe to do from other threads, signal or returns.
similar contexts (see the discussion of \f(CW\*(C`EV_ATOMIC_T\*(C'\fR in the embedding .Sp
section below on what exactly this means). Unlike \f(CW\*(C`ev_feed_event\*(C'\fR, this call is safe to do from other threads,
signal or similar contexts (see the discussion of \f(CW\*(C`EV_ATOMIC_T\*(C'\fR in the
embedding section below on what exactly this means).
.Sp .Sp
Note that, as with other watchers in libev, multiple events might get Note that, as with other watchers in libev, multiple events might get
compressed into a single callback invocation (another way to look at this compressed into a single callback invocation (another way to look at this
@ -3660,7 +3669,7 @@ First, you need to associate some data with the event loop:
\& ev_set_invoke_pending_cb (EV_A_ l_invoke); \& ev_set_invoke_pending_cb (EV_A_ l_invoke);
\& ev_set_loop_release_cb (EV_A_ l_release, l_acquire); \& ev_set_loop_release_cb (EV_A_ l_release, l_acquire);
\& \&
\& // then create the thread running ev_loop \& // then create the thread running ev_run
\& pthread_create (&u\->tid, 0, l_run, EV_A); \& pthread_create (&u\->tid, 0, l_run, EV_A);
\& } \& }
.Ve .Ve
@ -5290,7 +5299,7 @@ The physical time that is observed. It is apparently strictly monotonic :)
.IP "wall-clock time" 4 .IP "wall-clock time" 4
.IX Item "wall-clock time" .IX Item "wall-clock time"
The time and date as shown on clocks. Unlike real time, it can actually The time and date as shown on clocks. Unlike real time, it can actually
be wrong and jump forwards and backwards, e.g. when the you adjust your be wrong and jump forwards and backwards, e.g. when you adjust your
clock. clock.
.IP "watcher" 4 .IP "watcher" 4
.IX Item "watcher" .IX Item "watcher"
@ -5299,4 +5308,4 @@ to be started (attached to an event loop) before they can receive events.
.SH "AUTHOR" .SH "AUTHOR"
.IX Header "AUTHOR" .IX Header "AUTHOR"
Marc Lehmann <libev@schmorp.de>, with repeated corrections by Mikael Marc Lehmann <libev@schmorp.de>, with repeated corrections by Mikael
Magnusson and Emanuele Giaquinta. Magnusson and Emanuele Giaquinta, and minor corrections by many others.

47
deps/libev/ev.c

@ -378,7 +378,8 @@ EV_CPP(extern "C" {)
#endif #endif
#if !EV_USE_NANOSLEEP #if !EV_USE_NANOSLEEP
# ifndef _WIN32 /* hp-ux has it in sys/time.h, which we unconditionally include above */
# if !defined(_WIN32) && !defined(__hpux)
# include <sys/select.h> # include <sys/select.h>
# endif # endif
#endif #endif
@ -817,6 +818,14 @@ ev_sleep (ev_tstamp delay)
} }
} }
inline_speed int
ev_timeout_to_ms (ev_tstamp timeout)
{
int ms = timeout * 1000. + .999999;
return expect_true (ms) ? ms : timeout < 1e-6 ? 0 : 1;
}
/*****************************************************************************/ /*****************************************************************************/
#define MALLOC_ROUND 4096 /* prefer to allocate in chunks of this size, must be 2**n and >> 4 longs */ #define MALLOC_ROUND 4096 /* prefer to allocate in chunks of this size, must be 2**n and >> 4 longs */
@ -1328,12 +1337,12 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag)
} }
else else
#endif #endif
/* win32 people keep sending patches that change this write() to send() */
#ifdef __MINGW32__ /* and then run away. but send() is wrong, it wants a socket handle on win32 */
send(EV_FD_TO_WIN32_HANDLE(evpipe [1]), &dummy, 1, 0); /* so when you think this write should be a send instead, please find out */
#else /* where your send() is from - it's definitely not the microsoft send, and */
write (evpipe [1], &dummy, 1); /* tell me. thank you. */
#endif write (evpipe [1], &dummy, 1);
errno = old_errno; errno = old_errno;
} }
@ -1356,13 +1365,11 @@ pipecb (EV_P_ ev_io *iow, int revents)
#endif #endif
{ {
char dummy; char dummy;
#ifdef __MINGW32__ /* see discussion in evpipe_write when you think this read should be recv in win32 */
recv(EV_FD_TO_WIN32_HANDLE(evpipe [0]), &dummy, 1, 0);
#else
read (evpipe [0], &dummy, 1); read (evpipe [0], &dummy, 1);
#endif
} }
#if EV_SIGNAL_ENABLE
if (sig_pending) if (sig_pending)
{ {
sig_pending = 0; sig_pending = 0;
@ -1371,6 +1378,7 @@ pipecb (EV_P_ ev_io *iow, int revents)
if (expect_false (signals [i].pending)) if (expect_false (signals [i].pending))
ev_feed_signal_event (EV_A_ i + 1); ev_feed_signal_event (EV_A_ i + 1);
} }
#endif
#if EV_ASYNC_ENABLE #if EV_ASYNC_ENABLE
if (async_pending) if (async_pending)
@ -2201,6 +2209,15 @@ timers_reify (EV_P)
} }
#if EV_PERIODIC_ENABLE #if EV_PERIODIC_ENABLE
inline_speed void
periodic_recalc (EV_P_ ev_periodic *w)
{
/* TODO: use slow but potentially more correct incremental algo, */
/* also do not rely on ceil */
ev_at (w) = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval;
}
/* make periodics pending */ /* make periodics pending */
inline_size void inline_size void
periodics_reify (EV_P) periodics_reify (EV_P)
@ -2229,7 +2246,8 @@ periodics_reify (EV_P)
} }
else if (w->interval) else if (w->interval)
{ {
ev_at (w) = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; periodic_recalc (EV_A_ w);
/* if next trigger time is not sufficiently in the future, put it there */ /* if next trigger time is not sufficiently in the future, put it there */
/* this might happen because of floating point inexactness */ /* this might happen because of floating point inexactness */
if (ev_at (w) - ev_rt_now < TIME_EPSILON) if (ev_at (w) - ev_rt_now < TIME_EPSILON)
@ -2273,7 +2291,7 @@ periodics_reschedule (EV_P)
if (w->reschedule_cb) if (w->reschedule_cb)
ev_at (w) = w->reschedule_cb (w, ev_rt_now); ev_at (w) = w->reschedule_cb (w, ev_rt_now);
else if (w->interval) else if (w->interval)
ev_at (w) = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; periodic_recalc (EV_A_ w);
ANHE_at_cache (periodics [i]); ANHE_at_cache (periodics [i]);
} }
@ -2775,8 +2793,7 @@ ev_periodic_start (EV_P_ ev_periodic *w)
else if (w->interval) else if (w->interval)
{ {
assert (("libev: ev_periodic_start called with negative interval value", w->interval >= 0.)); assert (("libev: ev_periodic_start called with negative interval value", w->interval >= 0.));
/* this formula differs from the one in periodic_reify because we do not always round up */ periodic_recalc (EV_A_ w);
ev_at (w) = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval;
} }
else else
ev_at (w) = w->offset; ev_at (w) = w->offset;

4
deps/libev/ev.h

@ -185,7 +185,7 @@ struct ev_loop;
# define EV_INLINE static # define EV_INLINE static
#endif #endif
/* EV_PROTOTYPES can be sued to switch of prototype declarations */ /* EV_PROTOTYPES can be used to switch of prototype declarations */
#ifndef EV_PROTOTYPES #ifndef EV_PROTOTYPES
# define EV_PROTOTYPES 1 # define EV_PROTOTYPES 1
#endif #endif
@ -193,7 +193,7 @@ struct ev_loop;
/*****************************************************************************/ /*****************************************************************************/
#define EV_VERSION_MAJOR 4 #define EV_VERSION_MAJOR 4
#define EV_VERSION_MINOR 3 #define EV_VERSION_MINOR 4
/* eventmask, revents, events... */ /* eventmask, revents, events... */
enum { enum {

39
deps/libev/ev.pod

@ -60,7 +60,7 @@ libev - a high performance full-featured event loop written in C
// now wait for events to arrive // now wait for events to arrive
ev_run (loop, 0); ev_run (loop, 0);
// unloop was called, so exit // break was called, so exit
return 0; return 0;
} }
@ -444,6 +444,9 @@ This behaviour is useful when you want to do your own signal handling, or
want to handle signals only in specific threads and want to avoid libev want to handle signals only in specific threads and want to avoid libev
unblocking the signals. unblocking the signals.
It's also required by POSIX in a threaded program, as libev calls
C<sigprocmask>, whose behaviour is officially unspecified.
This flag's behaviour will become the default in future versions of libev. This flag's behaviour will become the default in future versions of libev.
=item C<EVBACKEND_SELECT> (value 1, portable select backend) =item C<EVBACKEND_SELECT> (value 1, portable select backend)
@ -867,7 +870,7 @@ anymore.
... queue jobs here, make sure they register event watchers as long ... queue jobs here, make sure they register event watchers as long
... as they still have work to do (even an idle watcher will do..) ... as they still have work to do (even an idle watcher will do..)
ev_run (my_loop, 0); ev_run (my_loop, 0);
... jobs done or somebody called unloop. yeah! ... jobs done or somebody called break. yeah!
=item ev_break (loop, how) =item ev_break (loop, how)
@ -1377,8 +1380,10 @@ Before a watcher can be registered with the event looop it has to be
initialised. This can be done with a call to C<ev_TYPE_init>, or calls to initialised. This can be done with a call to C<ev_TYPE_init>, or calls to
C<ev_init> followed by the watcher-specific C<ev_TYPE_set> function. C<ev_init> followed by the watcher-specific C<ev_TYPE_set> function.
In this state it is simply some block of memory that is suitable for use In this state it is simply some block of memory that is suitable for
in an event loop. It can be moved around, freed, reused etc. at will. use in an event loop. It can be moved around, freed, reused etc. at
will - as long as you either keep the memory contents intact, or call
C<ev_TYPE_init> again.
=item started/running/active =item started/running/active
@ -1416,8 +1421,9 @@ of whether it was active or not, so stopping a watcher explicitly before
freeing it is often a good idea. freeing it is often a good idea.
While stopped (and not pending) the watcher is essentially in the While stopped (and not pending) the watcher is essentially in the
initialised state, that is it can be reused, moved, modified in any way initialised state, that is, it can be reused, moved, modified in any way
you wish. you wish (but when you trash the memory block, you need to C<ev_TYPE_init>
it again).
=back =back
@ -2302,7 +2308,8 @@ and unblock them in an C<ev_prepare> watcher.
Both the signal mask (C<sigprocmask>) and the signal disposition Both the signal mask (C<sigprocmask>) and the signal disposition
(C<sigaction>) are unspecified after starting a signal watcher (and after (C<sigaction>) are unspecified after starting a signal watcher (and after
stopping it again), that is, libev might or might not block the signal, stopping it again), that is, libev might or might not block the signal,
and might or might not set or restore the installed signal handler. and might or might not set or restore the installed signal handler (but
see C<EVFLAG_NOSIGMASK>).
While this does not matter for the signal disposition (libev never While this does not matter for the signal disposition (libev never
sets signals to C<SIG_IGN>, so handlers will be reset to C<SIG_DFL> on sets signals to C<SIG_IGN>, so handlers will be reset to C<SIG_DFL> on
@ -3183,7 +3190,7 @@ cleanup functions are called.
=head2 C<ev_async> - how to wake up an event loop =head2 C<ev_async> - how to wake up an event loop
In general, you cannot use an C<ev_run> from multiple threads or other In general, you cannot use an C<ev_loop> from multiple threads or other
asynchronous sources such as signal handlers (as opposed to multiple event asynchronous sources such as signal handlers (as opposed to multiple event
loops - those are of course safe to use in different threads). loops - those are of course safe to use in different threads).
@ -3303,10 +3310,12 @@ trust me.
=item ev_async_send (loop, ev_async *) =item ev_async_send (loop, ev_async *)
Sends/signals/activates the given C<ev_async> watcher, that is, feeds Sends/signals/activates the given C<ev_async> watcher, that is, feeds
an C<EV_ASYNC> event on the watcher into the event loop. Unlike an C<EV_ASYNC> event on the watcher into the event loop, and instantly
C<ev_feed_event>, this call is safe to do from other threads, signal or returns.
similar contexts (see the discussion of C<EV_ATOMIC_T> in the embedding
section below on what exactly this means). Unlike C<ev_feed_event>, this call is safe to do from other threads,
signal or similar contexts (see the discussion of C<EV_ATOMIC_T> in the
embedding section below on what exactly this means).
Note that, as with other watchers in libev, multiple events might get Note that, as with other watchers in libev, multiple events might get
compressed into a single callback invocation (another way to look at this compressed into a single callback invocation (another way to look at this
@ -3542,7 +3551,7 @@ First, you need to associate some data with the event loop:
ev_set_invoke_pending_cb (EV_A_ l_invoke); ev_set_invoke_pending_cb (EV_A_ l_invoke);
ev_set_loop_release_cb (EV_A_ l_release, l_acquire); ev_set_loop_release_cb (EV_A_ l_release, l_acquire);
// then create the thread running ev_loop // then create the thread running ev_run
pthread_create (&u->tid, 0, l_run, EV_A); pthread_create (&u->tid, 0, l_run, EV_A);
} }
@ -5217,7 +5226,7 @@ The physical time that is observed. It is apparently strictly monotonic :)
=item wall-clock time =item wall-clock time
The time and date as shown on clocks. Unlike real time, it can actually The time and date as shown on clocks. Unlike real time, it can actually
be wrong and jump forwards and backwards, e.g. when the you adjust your be wrong and jump forwards and backwards, e.g. when you adjust your
clock. clock.
=item watcher =item watcher
@ -5230,5 +5239,5 @@ to be started (attached to an event loop) before they can receive events.
=head1 AUTHOR =head1 AUTHOR
Marc Lehmann <libev@schmorp.de>, with repeated corrections by Mikael Marc Lehmann <libev@schmorp.de>, with repeated corrections by Mikael
Magnusson and Emanuele Giaquinta. Magnusson and Emanuele Giaquinta, and minor corrections by many others.

2
deps/libev/ev_epoll.c

@ -148,7 +148,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
/* the default libev max wait time, however. */ /* the default libev max wait time, however. */
EV_RELEASE_CB; EV_RELEASE_CB;
eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax, eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax,
epoll_epermcnt ? 0 : (int)ceil (timeout * 1000.)); epoll_epermcnt ? 0 : ev_timeout_to_ms (timeout));
EV_ACQUIRE_CB; EV_ACQUIRE_CB;
if (expect_false (eventcnt < 0)) if (expect_false (eventcnt < 0))

4
deps/libev/ev_poll.c

@ -1,7 +1,7 @@
/* /*
* libev poll fd activity backend * libev poll fd activity backend
* *
* Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libev@schmorp.de> * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modifica- * Redistribution and use in source and binary forms, with or without modifica-
@ -92,7 +92,7 @@ poll_poll (EV_P_ ev_tstamp timeout)
int res; int res;
EV_RELEASE_CB; EV_RELEASE_CB;
res = poll (polls, pollcnt, (int)ceil (timeout * 1000.)); res = poll (polls, pollcnt, ev_timeout_to_ms (timeout));
EV_ACQUIRE_CB; EV_ACQUIRE_CB;
if (expect_false (res < 0)) if (expect_false (res < 0))

2
deps/libev/ev_port.c

@ -1,7 +1,7 @@
/* /*
* libev solaris event port backend * libev solaris event port backend
* *
* Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libev@schmorp.de> * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modifica- * Redistribution and use in source and binary forms, with or without modifica-

5
deps/libev/ev_select.c

@ -39,8 +39,11 @@
#ifndef _WIN32 #ifndef _WIN32
/* for unix systems */ /* for unix systems */
# include <sys/select.h>
# include <inttypes.h> # include <inttypes.h>
# ifndef __hpux
/* for REAL unix systems */
# include <sys/select.h>
# endif
#endif #endif
#ifndef EV_SELECT_USE_FD_SET #ifndef EV_SELECT_USE_FD_SET

4
deps/libev/libev.m4

@ -6,7 +6,7 @@ AC_CHECK_HEADERS(sys/inotify.h sys/epoll.h sys/event.h port.h poll.h sys/select.
AC_CHECK_FUNCS(inotify_init epoll_ctl kqueue port_create poll select eventfd signalfd) AC_CHECK_FUNCS(inotify_init epoll_ctl kqueue port_create poll select eventfd signalfd)
AC_CHECK_FUNC(clock_gettime, [], [ AC_CHECK_FUNCS(clock_gettime, [], [
dnl on linux, try syscall wrapper first dnl on linux, try syscall wrapper first
if test $(uname) = Linux; then if test $(uname) = Linux; then
AC_MSG_CHECKING(for clock_gettime syscall) AC_MSG_CHECKING(for clock_gettime syscall)
@ -27,7 +27,7 @@ AC_CHECK_FUNC(clock_gettime, [], [
fi fi
]) ])
AC_CHECK_FUNC(nanosleep, [], [ AC_CHECK_FUNCS(nanosleep, [], [
if test -z "$LIBEV_M4_AVOID_LIBRT"; then if test -z "$LIBEV_M4_AVOID_LIBRT"; then
AC_CHECK_LIB(rt, nanosleep) AC_CHECK_LIB(rt, nanosleep)
unset ac_cv_func_nanosleep unset ac_cv_func_nanosleep

Loading…
Cancel
Save