- Select (Unix)
select is a
system call for polling multiplefile descriptors . InC programming , it is declared in the header filesys/select.h orunistd.h . Those files andsys/time.h must be included to use select.int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* errorfds, struct timeval* timeout);
To manipulate the fd_set type arguments, the four FD_SET(), FD_CLR(), FD_ZERO() and FD_ISSET() macros can be used.
The function returns the total number of bits set in "readfds", "writefds" and "errorfds", the value of zero if the timeout expired and -1 on error.
External references
* [http://www.cl.cam.ac.uk/cgi-bin/manpage?2+select Unix Manual Page for select]
Wikimedia Foundation. 2010.