1 .. -*- coding: utf-8; mode: rst -*-
12 cec-poll - Wait for some event on a file descriptor
23 .. c:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout )
30 List of FD events to be watched
33 Number of FD events at the \*ufds array
36 Timeout to wait for events
42 With the :c:func:`poll() <cec-poll>` function applications can wait for CEC
45 On success :c:func:`poll() <cec-poll>` returns the number of file descriptors
46 that have been selected (that is, file descriptors for which the
47 ``revents`` field of the respective struct :c:type:`pollfd`
48 is non-zero). CEC devices set the ``POLLIN`` and ``POLLRDNORM`` flags in
49 the ``revents`` field if there are messages in the receive queue. If the
50 transmit queue has room for new messages, the ``POLLOUT`` and
51 ``POLLWRNORM`` flags are set. If there are events in the event queue,
52 then the ``POLLPRI`` flag is set. When the function times out it returns
53 a value of zero, on failure it returns -1 and the ``errno`` variable is
56 For more details see the :c:func:`poll() <cec-poll>` manual page.
62 On success, :c:func:`poll() <cec-poll>` returns the number structures which have
63 non-zero ``revents`` fields, or zero if the call timed out. On error -1
64 is returned, and the ``errno`` variable is set appropriately:
67 One or more of the ``ufds`` members specify an invalid file
71 ``ufds`` references an inaccessible memory area.
74 The call was interrupted by a signal.
77 The ``nfds`` argument is greater than ``OPEN_MAX``.