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

   depends-on: apache/nuttx/pull/21943
   
   ## Summary
   
   Add `pwait_test()` to ostest. The thread blocks `SIGUSR1` and unblocks it 
only in the mask of `ppoll()`, `pselect()` or `epoll_pwait()`. For each call 
there are two cases: `SIGUSR1` is pending before the call, and another thread 
sends `SIGUSR1` during the wait. The call must return `EINTR` after the handler 
ran once, and `SIGUSR1` must be blocked again after the call.
   
   The calls wait with no descriptor (an empty fd set, an empty epoll set), so 
the test needs no pipe and no other driver.
   
   ## Impact
   
   ostest only. The test is built when signals and pthreads are enabled. On a 
correct kernel it adds about 0.3 s to ostest.
   
   On master, `epoll_pwait()` fails the test (apache/nuttx#21943 fixes it), so 
this PR must merge after that one. `ppoll()` and `pselect()` pass on master.
   
   ## Testing
   
   QEMU with HVF on an Apple Mac (arm64), `qemu-armv8a:knsh` (kernel build) and 
`qemu-armv8a:nsh` (flat build).
   
   nuttx master, knsh:
   ```
   pwait_test: ERROR: epoll_pwait, signal pending: ret -1 errno 4 handler ran 0 
times
   pwait_test: ERROR: epoll_pwait, signal during the wait: ret -1 errno 4 
handler ran 0 times
   pwait_test: ERROR: 2 checks failed
   ```
   
   nuttx master, nsh:
   ```
   pwait_test: ERROR: epoll_pwait, signal pending: ret 0 errno 4 handler ran 1 
times
   pwait_test: ERROR: 1 checks failed
   ```
   
   With apache/nuttx#21943: `pwait_test: PASS` and `ostest_main: Exiting with 
status 0` on knsh and nsh.
   
   Also built in `rv-virt:knsh64`, `rv-virt:knsh`, `rv-virt:nsh64`, 
`lm3s6965-ek:qemu-protected`, `lm3s6965-ek:qemu-kostest` and 
`lm3s6965-ek:qemu-flat`.
   
   `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