1 .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
12 request-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 file descriptor events to be watched
33 Number of file descriptor events at the \*ufds array
36 Timeout to wait for events
42 With the :c:func:`poll() <request-func-poll>` function applications can wait
43 for a request to complete.
45 On success :c:func:`poll() <request-func-poll>` returns the number of file
46 descriptors 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). Request file descriptor set the ``POLLPRI`` flag in ``revents``
49 when the request was completed. When the function times out it returns
50 a value of zero, on failure it returns -1 and the ``errno`` variable is
53 Attempting to poll for a request that is not yet queued will
54 set the ``POLLERR`` flag in ``revents``.
60 On success, :c:func:`poll() <request-func-poll>` returns the number of
61 structures which have non-zero ``revents`` fields, or zero if the call
62 timed out. On error -1 is returned, and the ``errno`` variable is set
66 One or more of the ``ufds`` members specify an invalid file
70 ``ufds`` references an inaccessible memory area.
73 The call was interrupted by a signal.
76 The ``nfds`` value exceeds the ``RLIMIT_NOFILE`` value. Use
77 ``getrlimit()`` to obtain this value.