However, with the c10k problem, both select and poll have been superseded by the likes of kqueue, epoll, /dev/poll and I/O completion ports.
[2] One common use of select outside of its stated use of waiting on filehandles is to implement a portable sub-second sleep.
In the C programming language, the select system call is declared in the header file sys/select.h or unistd.h, and has the following syntax: fd_set type arguments may be manipulated with four utility macros: FD_SET(), FD_CLR(), FD_ZERO(), and FD_ISSET().
Select returns the total number of bits set in readfds, writefds and errorfds, or zero if the timeout expired, and -1 on error.
The sets of file descriptor used in select are finite in size, depending on the operating system.