1 .. -*- coding: utf-8; mode: rst -*-
11 Wait for some event on a file descriptor
22 .. c:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout )
27 Note: this documents the proposed CEC API. This API is not yet finalized
28 and is currently only available as a staging kernel module.
30 With the :c:func:`poll()` function applications can wait for CEC
33 On success :c:func:`poll()` returns the number of file descriptors
34 that have been selected (that is, file descriptors for which the
35 ``revents`` field of the respective :c:type:`struct pollfd` structure
36 is non-zero). CEC devices set the ``POLLIN`` and ``POLLRDNORM`` flags in
37 the ``revents`` field if there are messages in the receive queue. If the
38 transmit queue has room for new messages, the ``POLLOUT`` and
39 ``POLLWRNORM`` flags are set. If there are events in the event queue,
40 then the ``POLLPRI`` flag is set. When the function timed out it returns
41 a value of zero, on failure it returns -1 and the ``errno`` variable is
44 For more details see the :c:func:`poll()` manual page.
50 On success, :c:func:`poll()` returns the number structures which have
51 non-zero ``revents`` fields, or zero if the call timed out. On error -1
52 is returned, and the ``errno`` variable is set appropriately:
55 One or more of the ``ufds`` members specify an invalid file
59 ``ufds`` references an inaccessible memory area.
62 The call was interrupted by a signal.
65 The ``nfds`` argument is greater than ``OPEN_MAX``.
68 .. ------------------------------------------------------------------------------
69 .. This file was automatically converted from DocBook-XML with the dbxml
70 .. library (https://github.com/return42/sphkerneldoc). The origin XML comes
71 .. from the linux kernel, refer to:
73 .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
74 .. ------------------------------------------------------------------------------