SELECT(2)

NAME
select, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O multiplexing

SYNOPSIS
#include <sys/select.h>
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout)
void FD_CLR(int fd, fd_set *fdset)
int FD_ISSET(int fd, fd_set *fdset)
void FD_SET(int fd, fd_set *fdset)
void FD_ZERO(fd_set *fdset)

DESCRIPTION
Select examines the file descriptors given in the sets readfds, writefds, and errorfds, up to and including file descriptor nfds-1 , for reading, writing, or exceptional conditions, respectively. Select currently supports regular files, pipes, named pipes, inet, and tty file descriptors (including pty). If the readfds argument is not a null pointer, it points to an object of type fd_set that on input specifies the file descriptors to be checked for being ready to read, and on output indicates which file descriptors are ready to read. Writefds and errorfds have an analogous meaning for file descriptors to be checked for being ready to read, respectively have pending exceptional (error) conditions.