… | |
… | |
83 | { |
83 | { |
84 | int res, i; |
84 | int res, i; |
85 | struct timespec ts; |
85 | struct timespec ts; |
86 | uint_t nget = 1; |
86 | uint_t nget = 1; |
87 | |
87 | |
|
|
88 | if (expect_false (suspend_cb)) suspend_cb (EV_A); |
88 | ts.tv_sec = (time_t)timeout; |
89 | ts.tv_sec = (time_t)timeout; |
89 | ts.tv_nsec = (long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9; |
90 | ts.tv_nsec = (long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9; |
90 | res = port_getn (backend_fd, port_events, port_eventmax, &nget, &ts); |
91 | res = port_getn (backend_fd, port_events, port_eventmax, &nget, &ts); |
|
|
92 | if (expect_false (resume_cb)) resume_cb (EV_A); |
91 | |
93 | |
92 | if (res == -1) |
94 | if (res == -1) |
93 | { |
95 | { |
94 | if (errno != EINTR && errno != ETIME) |
96 | if (errno != EINTR && errno != ETIME) |
95 | ev_syserr ("(libev) port_getn"); |
97 | ev_syserr ("(libev) port_getn"); |