This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 97b5dde73e227cbf2ebfc288feff16b54ff436e0
Author: Marco Casaroli <[email protected]>
AuthorDate: Mon Oct 19 00:34:31 2026 +0200

    Documentation: Describe struct pollfd and struct pollfd_s.
    
    The poll() method of a driver takes struct pollfd_s now.  Say what
    struct pollfd_s holds, and give the POSIX fields of struct pollfd in
    the poll() reference, with a link to <poll.h> in IEEE Std 1003.1-2017
    (Revision of IEEE Std 1003.1-2008) / The Open Group Base Specifications
    Issue 7, 2018 edition.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 Documentation/os/filesystem/index.rst          | 9 +++++++--
 Documentation/reference/user/10_filesystem.rst | 7 +++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/Documentation/os/filesystem/index.rst 
b/Documentation/os/filesystem/index.rst
index 3df0b6b0b29..6979c661e4a 100644
--- a/Documentation/os/filesystem/index.rst
+++ b/Documentation/os/filesystem/index.rst
@@ -239,14 +239,19 @@ belonging to a unified interface:
   :retval OK (0): Success.
   :retval < 0: Error.
 
-.. c:function:: int poll(FAR struct file *filep, FAR struct pollfd *fds, bool 
setup)
+.. c:function:: int poll(FAR struct file *filep, FAR struct pollfd_s *fds, 
bool setup)
 
   Underlying implementation of ``poll()``. The ``poll()`` function provides
   applications with a mechanism for multiplexing input/output over a set of
   file descriptors.
 
+  ``struct pollfd_s`` (``include/nuttx/poll.h``) is the kernel copy of one
+  ``struct pollfd`` entry. It has 32-bit ``events`` and ``revents`` and the
+  fields ``arg``, ``cb`` and ``priv`` that the kernel and the driver use.
+  The driver reports events with ``poll_notify()``.
+
   :param FAR struct file * filep: Open file's pointer.
-  :param FAR struct pollfd * fds: The structure describing the events to be
+  :param FAR struct pollfd_s * fds: The structure describing the events to be
     monitored, OR NULL if this is a request to stop monitoring events.
   :param bool setup: true: Setup up the poll; false: Teardown the poll
   :returns: Status of poll operation.
diff --git a/Documentation/reference/user/10_filesystem.rst 
b/Documentation/reference/user/10_filesystem.rst
index 73208a50dd0..f59bc847efe 100644
--- a/Documentation/reference/user/10_filesystem.rst
+++ b/Documentation/reference/user/10_filesystem.rst
@@ -88,6 +88,13 @@ Driver Operations
   error) has occurred for any of the file descriptors, then ``poll()``
   blocks until one of the events occurs.
 
+  Each entry of ``fds`` is a ``struct pollfd`` with the POSIX fields
+  ``int fd``, ``short events`` and ``short revents``, as in
+  `<poll.h> 
<https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/basedefs/poll.h.html>`_
+  of IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008) / The Open
+  Group Base Specifications Issue 7, 2018 edition. The kernel does not
+  keep any state in the array, so several threads can poll the same array.
+
   **Configuration Settings**. In order to use the select with TCP/IP
   sockets test, you must have the following things selected in your NuttX
   configuration file:

Reply via email to