Browse Source

*** empty log message ***

master
Marc Alexander Lehmann 1 year ago
parent
commit
89d55438b8
6 changed files with 26 additions and 19 deletions
  1. +2
    -1
      Changes
  2. +11
    -5
      ev.3
  3. +10
    -10
      ev.c
  4. +1
    -1
      ev_epoll.c
  5. +1
    -1
      ev_poll.c
  6. +1
    -1
      ev_port.c

+ 2
- 1
Changes View File

@ -11,6 +11,7 @@ TODO: maybe use timerfd to detect time jumps on linux
libecb counterparts.
- move syscall infrastructure from ev_linuxaio.c to ev.c.
- prepare io_uring integration.
- tweak ev_floor.
4.27 Thu Jun 27 22:43:44 CEST 2019
- linux aio backend almost completely rewritten to work around its
@ -35,7 +36,7 @@ TODO: maybe use timerfd to detect time jumps on linux
4.25 Fri Dec 21 07:49:20 CET 2018
- INCOMPATIBLE CHANGE: EV_THROW was renamed to EV_NOEXCEPT
(EV_THROW still provided) and now uses noexcept on C++11 or newer.
- move the darwin select workaround highe rin ev.c, as newer versions of
- move the darwin select workaround higher in ev.c, as newer versions of
darwin managed to break their broken select even more.
- ANDROID => __ANDROID__ (reported by enh@google.com).
- disable epoll_create1 on android because it has broken header files


+ 11
- 5
ev.3 View File

@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "LIBEV 3"
.TH LIBEV 3 "2019-06-25" "libev-4.25" "libev - high performance full featured event loop"
.TH LIBEV 3 "2019-07-07" "libev-4.27" "libev - high performance full featured event loop"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@ -1873,7 +1873,7 @@ reuse the same code path.
\fIThe special problem of fork\fR
.IX Subsection "The special problem of fork"
.PP
Some backends (epoll, kqueue, probably linuxaio) do not support \f(CW\*(C`fork ()\*(C'\fR
Some backends (epoll, kqueue, linuxaio, iouring) do not support \f(CW\*(C`fork ()\*(C'\fR
at all or exhibit useless behaviour. Libev fully supports fork, but needs
to be told about it in the child if you want to continue to use it in the
child.
@ -4626,6 +4626,7 @@ in your include path (e.g. in libev/ when using \-Ilibev):
\& ev_poll.c only when poll backend is enabled
\& ev_epoll.c only when the epoll backend is enabled
\& ev_linuxaio.c only when the linux aio backend is enabled
\& ev_iouring.c only when the linux io_uring backend is enabled
\& ev_kqueue.c only when the kqueue backend is enabled
\& ev_port.c only when the solaris port backend is enabled
.Ve
@ -4818,10 +4819,15 @@ backend for GNU/Linux systems. If undefined, it will be enabled if the
headers indicate GNU/Linux + Glibc 2.4 or newer, otherwise disabled.
.IP "\s-1EV_USE_LINUXAIO\s0" 4
.IX Item "EV_USE_LINUXAIO"
If defined to be \f(CW1\fR, libev will compile in support for the Linux aio
backend (\f(CW\*(C`EV_USE_EPOLL\*(C'\fR must also be enabled). If undefined, it will be
enabled on linux, otherwise disabled.
.IP "\s-1EV_USE_IOURING\s0" 4
.IX Item "EV_USE_IOURING"
If defined to be \f(CW1\fR, libev will compile in support for the Linux
aio backend. Due to it's currenbt limitations it has to be requested
explicitly. If undefined, it will be enabled on linux, otherwise
disabled.
io_uring backend (\f(CW\*(C`EV_USE_EPOLL\*(C'\fR must also be enabled). Due to it's
current limitations it has to be requested explicitly. If undefined, it
will be enabled on linux, otherwise disabled.
.IP "\s-1EV_USE_KQUEUE\s0" 4
.IX Item "EV_USE_KQUEUE"
If defined to be \f(CW1\fR, libev will compile in support for the \s-1BSD\s0 style


+ 10
- 10
ev.c View File

@ -1728,26 +1728,26 @@ ev_floor (ev_tstamp v)
const ev_tstamp shift = sizeof (unsigned long) >= 8 ? 18446744073709551616. : 4294967296.;
#endif
/* argument too large for an unsigned long? */
/* special treatment for negative arguments */
if (ecb_expect_false (v < 0.))
{
ev_tstamp f = -ev_floor (-v);
return f - (f == v ? 0 : 1);
}
/* argument too large for an unsigned long? then reduce it */
if (ecb_expect_false (v >= shift))
{
ev_tstamp f;
if (v == v - 1.)
return v; /* very large number */
return v; /* very large numbers are assumed to be integer */
f = shift * ev_floor (v * (1. / shift));
return f + ev_floor (v - f);
}
/* special treatment for negative args? */
if (ecb_expect_false (v < 0.))
{
ev_tstamp f = -ev_floor (-v);
return f - (f == v ? 0 : 1);
}
/* fits into an unsigned long */
return (unsigned long)v;
}


+ 1
- 1
ev_epoll.c View File

@ -152,7 +152,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
/* epoll wait times cannot be larger than (LONG_MAX - 999UL) / HZ msecs, which is below */
/* the default libev max wait time, however. */
EV_RELEASE_CB;
eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax, timeout * 1e3);
eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax, timeout * 1e3 + 0.9999);
EV_ACQUIRE_CB;
if (ecb_expect_false (eventcnt < 0))


+ 1
- 1
ev_poll.c View File

@ -95,7 +95,7 @@ poll_poll (EV_P_ ev_tstamp timeout)
int res;
EV_RELEASE_CB;
res = poll (polls, pollcnt, timeout * 1e3);
res = poll (polls, pollcnt, timeout * 1e3 + 0.9999);
EV_ACQUIRE_CB;
if (ecb_expect_false (res < 0))


+ 1
- 1
ev_port.c View File

@ -154,7 +154,7 @@ port_init (EV_P_ int flags)
/* if my reading of the opensolaris kernel sources are correct, then
* opensolaris does something very stupid: it checks if the time has already
* elapsed and doesn't round up if that is the case,m otherwise it DOES round
* elapsed and doesn't round up if that is the case, otherwise it DOES round
* up. Since we can't know what the case is, we need to guess by using a
* "large enough" timeout. Normally, 1e-9 would be correct.
*/


Loading…
Cancel
Save