casaroli opened a new pull request, #20931:
URL: https://github.com/apache/nuttx/pull/20931

   ## Summary
   
   `wait3()` waits for any child and returns its resource usage. POSIX no 
longer has it, but programs still call it. NuttX has `wait4()`, but not 
`wait3()`.
   
   This PR adds `wait3()` to libc as `wait4(-1, ...)`, next to `wait4()` and 
with the same condition (`CONFIG_SCHED_WAITPID`), and its prototype in 
`<sys/wait.h>`.
   
   ## Impact
   
   New function in libc; no other change. All build modes: libc calls 
`wait4()`, so no new system call. Documentation: no change (`wait3()` is not in 
the POSIX table, and no page lists `wait4()`).
   
   ## Testing
   
   Test program `wait3test.c`: it forks a child that exits with 7, and 
`wait3(&status, 0, NULL)` must return that child with that status. Then it 
forks a child that exits with 3 and polls `wait3(&status, WNOHANG, &ru)` until 
it returns that child.
   
   | | master | this PR |
   |---|---|---|
   | `wait3test.c` on `qemu-armv8a:knsh` (QEMU with HVF, 
`CONFIG_SCHED_CHILD_STATUS=y`) | does not compile: implicit declaration of 
`wait3` | PASS |
   | ostest, `qemu-armv8a:knsh` and `qemu-armv8a:nsh` | status 0 | status 0 |
   
   Build, each OK: `qemu-armv8a:nsh` (flat, arm64), `qemu-armv8a:knsh` (kernel, 
arm64), `rv-virt:knsh64` (kernel, rv64), `rv-virt:pnsh64` (protected, rv64), 
`lm3s6965-ek:qemu-protected` (protected, armv7-m), and `qemu-armv8a:nsh` with 
CMake. No new warnings.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to