1.1.27.14 poll
C
int poll(struct pollfd *fds, nfds_t nfds, int timeout)Description
Wait for some event on a file descriptor.
Parameters
| Parameters | Description |
|---|---|
| fds | Set of file descriptors to be monitored. |
| nfds | Number of items in the fds array. |
| timeout | Specifies the number of milliseconds to block block waiting for a file descriptor to become ready.Must be 0. |
Returns
On success, poll() returns a nonnegative value which is the number of elements in the pollfds whose revents fields have been set to a nonzero value (indicating an event or an error).
A return value of zero indicates that the system call timed out before any file descriptors became ready.
On error, -1 is returned, and errno is set to indicate the error.
Remarks
| errno | Description |
|---|---|
| EFAULT | System fault. |
| EINVAL | The nfds value exceeds the WINC_SOCK_NUM_SOCKETS value. |
| fds events/revents | Description |
|---|---|
| POLLIN | There is data to read. |
| POLLOUT | Writing is now possible. |
| POLLHUP | Hang up (only returned in revents; ignored in events).Subsequent reads from the channel will return 0 (end of file) only after all outstanding data in the channel has been consumed. |
| POLLNVAL | Invalid request: fd not open (only returned in revents; ignored in events). |
