+ if (res < 0)
+ {
+ if (errno == EBADF)
+ fd_ebadf (EV_A);
+ else if (errno == ENOMEM && !syserr_cb)
+ fd_enomem (EV_A);
+ else if (errno != EINTR)
+ syserr ("(libev) poll");
+
+ return;
+ }
+
+ for (i = 0; i < pollcnt; ++i)
+ if (polls [i].revents & POLLNVAL)
+ fd_kill (EV_A_ polls [i].fd);
+ else
+ fd_event (
+ EV_A_
+ polls [i].fd,
+ (polls [i].revents & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0)
+ | (polls [i].revents & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0)
+ );
+}
+
+static int
+poll_init (EV_P_ int flags)
+{
+ method_fudge = 1e-3; /* needed to compensate for select returning early, very conservative */
+ method_modify = poll_modify;
+ method_poll = poll_poll;