From 564db33b82e7bee7ee6ecf032533562c3847f164 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 2 May 2018 06:49:56 +0200 Subject: [PATCH] doc: expand epoll_wait() documentation --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 356e217..fdaf549 100644 --- a/README.md +++ b/README.md @@ -114,11 +114,19 @@ int epoll_wait(HANDLE ephnd, ``` * Receive socket events from an epoll port. -* Returns - - -1 on failure - - 0 when a timeout occurs - - ≥1 the number of evens received -* TODO: expand +* `events` should point to a caller-allocated array of + [`epoll_event`](#struct-epoll_event) structs, which will receive the + reported events. +* `maxevents` is the maximum number of events that will be written to the + `events` array, and must be greater than zero. +* `timeout` specifies whether to block when no events are immediately available. + - `<0` block indefinitely + - `0` report any events that are already waiting, but don't block + - `≥1` block for at most N milliseconds +* Return value: + - `-1` an error occurred + - `0` timed out without any events to report + - `≥1` the number of events stored in the `events` buffer * [Linux man page][man epoll_wait] ### struct epoll_event