2.4. cec poll()¶
cec-poll - Wait for some event on a file descriptor
poll(struct pollfd *ufds, unsigned int nfds, int timeout)¶
- List of FD events to be watched
- Number of FD events at the *ufds array
- Timeout to wait for events
poll() function applications can wait for CEC
poll() returns the number of file descriptors
that have been selected (that is, file descriptors for which the
revents field of the respective struct
is non-zero). CEC devices set the
POLLRDNORM flags in
revents field if there are messages in the receive queue. If the
transmit queue has room for new messages, the
POLLWRNORM flags are set. If there are events in the event queue,
POLLPRI flag is set. When the function times out it returns
a value of zero, on failure it returns -1 and the
errno variable is
For more details see the
poll() manual page.
2.4.5. Return Value¶
poll() returns the number structures which have
revents fields, or zero if the call timed out. On error -1
is returned, and the
errno variable is set appropriately:
- One or more of the
ufdsmembers specify an invalid file descriptor.
ufdsreferences an inaccessible memory area.
- The call was interrupted by a signal.
nfdsvalue exceeds the
getrlimit()to obtain this value.