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

   ## Summary
   
   `pause()` is implemented in the kernel (`sched/signal/sig_pause.c`), but it 
had no entry in the system call table. So in a protected or kernel build a user 
program that calls `pause()` did not link.
   
   This PR adds `pause` to `syscall/syscall.csv` (in alphabetical order, with 
`!defined(CONFIG_DISABLE_ALL_SIGNALS)`, the condition under which `sig_pause.c` 
is built) and to `include/sys/syscall_lookup.h`, next to the other signal 
calls. libc has no conflicting `pause()`; `libs/libc/signal/sig_pause.c` is 
`sigpause()`.
   
   ## Impact
   
   `pause()` is available to user programs in protected and kernel builds. 
Adding a system call changes the numbers of the calls after it, as for any new 
system call; programs of a kernel build must be built again. Flat builds are 
not affected.
   
   ## Testing
   
   A test program on `qemu-armv8a:knsh` (QEMU 11 with HVF on an Apple M4): a 
thread sends `SIGUSR1` with `pthread_kill()` after 200 ms while the main thread 
is in `pause()`.
   
   - master: the program does not link (`undefined reference to pause`).
   - this PR: `pause()` returns -1 with `EINTR` after about 200 ms, and the 
handler ran once.
   
   `ostest` on `qemu-armv8a:knsh` and `qemu-armv8a:nsh` ends with `ostest_main: 
Exiting with status 0`. `lm3s6965-ek:qemu-protected` builds. 
`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