1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/media/uapi/fdl-appendix.rst.
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
19 cec-poll - Wait for some event on a file descriptor
30 .. c:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout )
37 List of FD events to be watched
40 Number of FD events at the \*ufds array
43 Timeout to wait for events
49 With the :c:func:`poll() <cec-poll>` function applications can wait for CEC
52 On success :c:func:`poll() <cec-poll>` returns the number of file descriptors
53 that have been selected (that is, file descriptors for which the
54 ``revents`` field of the respective struct :c:type:`pollfd`
55 is non-zero). CEC devices set the ``POLLIN`` and ``POLLRDNORM`` flags in
56 the ``revents`` field if there are messages in the receive queue. If the
57 transmit queue has room for new messages, the ``POLLOUT`` and
58 ``POLLWRNORM`` flags are set. If there are events in the event queue,
59 then the ``POLLPRI`` flag is set. When the function times out it returns
60 a value of zero, on failure it returns -1 and the ``errno`` variable is
63 For more details see the :c:func:`poll() <cec-poll>` manual page.
69 On success, :c:func:`poll() <cec-poll>` returns the number structures which have
70 non-zero ``revents`` fields, or zero if the call timed out. On error -1
71 is returned, and the ``errno`` variable is set appropriately:
74 One or more of the ``ufds`` members specify an invalid file
78 ``ufds`` references an inaccessible memory area.
81 The call was interrupted by a signal.
84 The ``nfds`` value exceeds the ``RLIMIT_NOFILE`` value. Use
85 ``getrlimit()`` to obtain this value.