Skip to main content

select

Function select 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn select( nfds: c_int, readfds: *mut fd_set, writefds: *mut fd_set, exceptfds: *mut fd_set, timeout: *mut timeval, ) -> c_int
Expand description

See https://pubs.opengroup.org/onlinepubs/9799919799/functions/select.html.

Examines the file descriptor sets whose addresses are passed in the readfds, writefds and errorfds parameters to see whether some of their descriptors are ready for reading, ready for writing, or have an exceptional condition pending, respectively.

timeout is given in seconds and microseconds as represented by timeval. Behaves as pselect() does when sigmask is a null pointer. When successful, may modify the object pointed to by timeout.

Upon success, returns the total number of bits set in the bit masks. Upon failure, returns -1 and sets errno to indicate the error.