From 75c3db6a55685361ac54f6d7f7f795729f50152f Mon Sep 17 00:00:00 2001 From: _ov4 Date: Mon, 19 Oct 2026 10:38:11 +0000 Subject: adapt selfpipe and signal process to sigchld handler --- src/signal/handler.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/signal/handler.cc (limited to 'src/signal/handler.cc') diff --git a/src/signal/handler.cc b/src/signal/handler.cc new file mode 100644 index 0000000..294ae53 --- /dev/null +++ b/src/signal/handler.cc @@ -0,0 +1,32 @@ +#include "signal_handler.h" + +#include +#include +#include + +using namespace std; + +namespace ov4 +{ + +void process_signal() +{ + /* + * do NOT swap these statements + * otherwise, if process then unset flag, and another signal delivered + * it won't be processed + */ + if (check_signal_delivered(SIGCHLD)) + { + unset_signal_delivered(SIGCHLD); + process_sigchld(); + } +} + +void process_sigchld() +{ + print("hi\r\n"); + fflush(stdout); +} + +} \ No newline at end of file -- cgit v1.3.1-4-g156e