Epoll.wait

Calls epoll_wait() using the current epoll file descriptor.

events.length specifies the maximum number of file descriptors for which events can be reported with this epoll_wait() call.

The current epoll file descriptor should have been sucessfully obtained by create() or epoll_create1() and not already been closed, otherwise epoll_ctl() will fail so that this method returns -1.

struct Epoll
int
wait
out (n) { assert (n <= cast(int)events.length); }

Parameters

events epoll_event_t[]

destination array for the reported events

timeout_ms int

timeout in ms or -1 to disable timing out

Return Value

Type: int

on success the number of file descriptors for which at least one event was reported. 0 indicates that this call timed out before an event on any file descriptor occurred. On error -1 is returned and errno set appropriately.

Meta