Main index | Section 2 | 日本語 | Deutsch | Options |
#include <sys/select.h>
The descriptor sets are stored as bit fields in arrays of integers. The following macros are provided for manipulating such descriptor sets: FD_ZERO(&fdset) initializes a descriptor set fdset to the null set. FD_SET(fd, &fdset) includes a particular descriptor fd in fdset. FD_CLR(fd, &fdset) removes fd from fdset. FD_ISSET(fd, &fdset) is non-zero if fd is a member of fdset, zero otherwise. The behavior of these macros is undefined if a descriptor value is less than zero or greater than or equal to FD_SETSIZE, which is normally at least equal to the maximum number of descriptors supported by the system.
If timeout is not a null pointer, it specifies the maximum interval to wait for the selection to complete. System activity can lengthen the interval by an indeterminate amount.
If timeout is a null pointer, the select blocks indefinitely.
To effect a poll, the timeout argument should not be a null pointer, but it should point to a zero-valued timeval structure.
Any of readfds, writefds, and exceptfds may be given as null pointers if no descriptors are of interest.
[EBADF] | |
One of the descriptor sets specified an invalid descriptor. | |
[EFAULT] | |
One of the arguments readfds, ,, writefds, ,, exceptfds, or timeout points to an invalid address. | |
[EINTR] | |
A signal was delivered before the time limit expired and before any of the selected events occurred. | |
[EINVAL] | |
The specified time limit is invalid. One of its components is negative or too large. | |
[EINVAL] | |
The nfds argument was invalid. | |
If nfds is greater than the number of open files, select() is not guaranteed to examine the unused file descriptors. For historical reasons, select() will always examine the first 256 descriptors.
SELECT (2) | June 25, 2020 |
Main index | Section 2 | 日本語 | Deutsch | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Do you laugh when the waiter drops a tray full of dishes? Unix weenies do. They're the first ones to laugh at hapless users, trying to figure out an error message that doesn't have anything to do with what they just typed. | ” |
— The Unix Haters' handbook |