Browse Source

*** empty log message ***

master
Marc Alexander Lehmann 2 years ago
parent
commit
df36a5aa32
  1. 5
      ev.pod
  2. 13
      ev_linuxaio.c

5
ev.pod

@ -600,8 +600,9 @@ backend will be skipped during initialisation.
Most problematic in practise, however, is that not all file descriptors
work with it. For example, in linux 5.1, tcp sockets, pipes, event fds,
files, F</dev/null> and a few others are supported, but ttys do not work
(probably because of a bug), so this is not (yet?) a generic event polling
interface.
properly (a known bug that the kernel developers don't care about, see
L<https://lore.kernel.org/patchwork/patch/1047453/>), so this is not
(yet?) a generic event polling interface.
To work around this latter problem, the current version of libev uses
epoll as a fallback for file deescriptor types that do not work. Epoll

13
ev_linuxaio.c

@ -338,9 +338,11 @@ linuxaio_poll (EV_P_ ev_tstamp timeout)
#if EPOLL_FALLBACK
else if (errno == EINVAL)
{
/* This hapüpens for unsupported fds, officially, but in my testing,
/* This happens for unsupported fds, officially, but in my testing,
* also randomly happens for supported fds. We fall back to good old
* poll() here, under the assumption that this is a very rare case.
* See https://lore.kernel.org/patchwork/patch/1047453/ for evidence
* that the problem is known, but ignored.
*/
struct iocb *iocb = linuxaio_submits [submitted];
res = 1; /* skip this iocb */
@ -406,8 +408,15 @@ linuxaio_init (EV_P_ int flags)
{
/* would be great to have a nice test for IOCB_CMD_POLL instead */
/* also: test some semi-common fd types, such as files and ttys in recommended_backends */
if (ev_linux_version () < 0x041200) /* 4.18 introduced IOCB_CMD_POLL */
#if EPOLL_FALLBACK
/* 4.19 made epoll work */
if (ev_linux_version () < 0x041300)
return 0;
#else
/* 4.18 introduced IOCB_CMD_POLL */
if (ev_linux_version () < 0x041200)
return 0;
#endif
linuxaio_ctx = 0;
if (ev_io_setup (EV_LINUXAIO_DEPTH, &linuxaio_ctx) < 0)

Loading…
Cancel
Save