Skip to main content

epoll_wait

Function epoll_wait 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn epoll_wait( epfd: c_int, events: *mut epoll_event, maxevents: c_int, timeout: c_int, ) -> c_int
Expand description

Non-POSIX, see https://man7.org/linux/man-pages/man2/epoll_wait.2.html.

Waits for events on the epoll instance referred to by the file descriptor epdf.

timeout represents the number of milliseconds this function call will block.

Will block until either:

  • a file descriptor delivers an event
  • the call is interrupted by a signal handler
  • the timeout expires

A timeout of -1 will block indefinitely. A timeout of 0 will return immediately, even if no events are available.

Upon success, returns the number of file descriptors ready for the requested I/O operation, or 0 if no file descriptor became ready during the requested timeout. Upon failure, returns -1 and sets errno to indicate the error.