Implementation of POSIX polling.
More...
|
typedef __uint32_t | nfds_t |
| Type representing a number of file descriptors.
|
|
|
int | poll (struct pollfd fds[], nfds_t nfds, int timeout) |
| Poll a group of file descriptors for activity.
|
|
Implementation of POSIX polling.
◆ nfds_t
Type representing a number of file descriptors.
◆ poll()
Poll a group of file descriptors for activity.
This function will poll a group of file descriptors to check for the events specified on them. The function shall block for the specified period of time (in milliseconds) waiting for an event to occur. The function shall return as soon as at least one fd matches the events specified (or one of the error conditions), or when timeout expires.
- Parameters
-
fds | The file descriptors to check, and what events to look for on each. |
nfds | Number of elements in fds. |
timeout | Maximum amount of time to block, in milliseconds. Pass 0 to ensure the function does not block and -1 to block for an "infinite" amount of time, until an event occurs. |
- Returns
- -1 on error (sets errno as appropriate), or the number of file descriptors that matched the event flags before the function returns.
- See also
- Events for the poll() function