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 dcaf0be558a8d3672495b9d318df87fb936dfe34
Author: Marco Casaroli <[email protected]>
AuthorDate: Tue Oct 20 10:41:46 2026 +0200

    Documentation: Describe how SIGCHLD controls the child status.
    
    sigaction(SIGCHLD) with SIG_IGN suppresses the retention of the child
    status like SA_NOCLDWAIT, and any other action keeps it again.  Without
    retention, the wait functions wait for all children and fail with
    ECHILD.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 Documentation/reference/user/03_task_control.rst | 7 +++++++
 Documentation/reference/user/07_signals.rst      | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Documentation/reference/user/03_task_control.rst 
b/Documentation/reference/user/03_task_control.rst
index 00fe36663d2..b133e3f68e6 100644
--- a/Documentation/reference/user/03_task_control.rst
+++ b/Documentation/reference/user/03_task_control.rst
@@ -115,6 +115,13 @@ like:
   sa.sa_flags = SA_NOCLDWAIT;
   int ret = sigaction(SIGCHLD, &sa, NULL);
 
+A later ``sigaction()`` for ``SIGCHLD`` without ``SA_NOCLDWAIT`` (and
+not ``SIG_IGN``) keeps the child status again.  While the status is not
+kept, ``wait()``, ``waitpid()`` and ``waitid()`` block until all
+children exit and then fail with ``ECHILD``.  NuttX decides when a child
+is created if its status is kept: a child created while the status is
+not kept does not become waitable later.
+
 Functions
 =========
 
diff --git a/Documentation/reference/user/07_signals.rst 
b/Documentation/reference/user/07_signals.rst
index ab7af3786fa..d8f396a09d1 100644
--- a/Documentation/reference/user/07_signals.rst
+++ b/Documentation/reference/user/07_signals.rst
@@ -278,7 +278,9 @@ provided by NuttX:
     -  All ``sa_flags`` in struct sigaction of act input are ignored (all
        treated like ``SA_SIGINFO``). The one exception is if
        ``CONFIG_SCHED_CHILD_STATUS`` is defined; then ``SA_NOCLDWAIT`` is
-       supported but only for ``SIGCHLD``.
+       supported but only for ``SIGCHLD``.  ``SIGCHLD`` set to ``SIG_IGN``
+       has the same effect if ``CONFIG_SIG_DEFAULT`` is defined.  Any
+       other action for ``SIGCHLD`` keeps the child status again.
 
 .. c:function:: int sigignore(int signo);
 

Reply via email to