[Overview][Constants][Types][Procedures and functions][Index] | Reference for unit 'Linux' (#rtl)

# epoll_wait

Wait for an event on an epoll file descriptor.

## Declaration

Source position: linux.pp line 288

`function epoll_wait(`
`epfd: cint;`
`events: PEpoll_Event;`
`maxevents: cint;`
`timeout: cint`
`):cint;`

## Description

epoll_wait waits for timeout milliseconds for an event to occur on epoll file descriptor epfd. If timeout is -1, it waits indefinitely, if timeour is zero, it does not wait, but returns immediately, even if no events were detected.

On return, data for at most maxevents will be returned in the memory pointed to by events. The function returns the number of file descriptors for which events were reported. This can be zero if the timeout was reached.

## Errors

On error -1 is returned, and errno is set accordingly.

## See also

epoll_create |  | Create new epoll file descriptor
epoll_ctl |  | Modify an epoll file descriptor
fpClose |  | Close file descriptor

Documentation generated on: May 14 2021