libubox/examples
Jo-Philipp Wich 13d9b04fb0 uloop: add support for user defined signal handlers
Reuse and extend the existing signal waker pipe mechanism to add user
defined signal handling functionality to uloop.

This commit introduces two new api functions `uloop_signal_add()` and
`uloop_signal_remove()` along with a new structure type `uloop_signal`
to allow adding and removing arbitrary signal handlers.

Registered signal handlers are maintained in a linked list and matched
by their signo member value which allows registering multiple handlers
for the same signal numbers.

Upon registering a new signal handler, the existing handler is saved
in the `uloop_signal` structure. When removing the user defined signal
handler, the original behavior is restored.

The Lua binding has been updated as well to support the new signal
handler mechanism.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-11-02 17:56:45 +01:00
..
CMakeLists.txt add cram based unit tests 2019-11-24 13:26:58 +01:00
json_script-example.c iron out all extra compiler warnings 2019-11-20 14:34:01 +01:00
json_script-example.json json_script: add "isdir" support 2016-02-20 13:36:08 +01:00
json_script-tests.sh examples: add shunit2 tests for json_script 2016-02-20 13:36:08 +01:00
shunit2 examples: add shunit2 tests for json_script 2016-02-20 13:36:08 +01:00
uloop-example.lua uloop: add support for user defined signal handlers 2023-11-02 17:56:45 +01:00
uloop_pid_test.sh add an example script for the uloop lua binding 2012-09-27 13:47:46 +02:00
ustream-example.c examples: add missing include 2014-07-03 12:53:13 +02:00