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

ParametersDescription
fdsSet of file descriptors to be monitored.
nfdsNumber of items in the fds array.
timeoutSpecifies 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

errnoDescription
EFAULTSystem fault.
EINVALThe nfds value exceeds the WINC_SOCK_NUM_SOCKETS value.
fds events/reventsDescription
POLLINThere is data to read.
POLLOUTWriting is now possible.
POLLHUPHang 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.
POLLNVALInvalid request: fd not open (only returned in revents; ignored in events).