+ if (timers) {
+ struct timemono now, first;
+
+ now = nowfn();
+
+ /* Call functions for expired timers. */
+ *expired = timers_expire(timers, now);
+ if (*expired)
+ break;
+
+ /* Now figure out how long to wait for the next one. */
+ if (timer_earliest(timers, &first)) {
+ uint64_t next;
+ next = time_to_msec(timemono_between(first, now));
+ if (next < INT_MAX)
+ ms_timeout = next;
+ else
+ ms_timeout = INT_MAX;
+ }
+ }
+
+ /* We do this temporarily, assuming exclusive is unusual */
+ exclude_pollfds();
+ r = pollfn(pollfds, num_fds, ms_timeout);
+ restore_pollfds();
+
+ if (r < 0) {
+ /* Signals shouldn't break us, unless they set
+ * io_loop_return. */
+ if (errno == EINTR)
+ continue;