aboutsummaryrefslogtreecommitdiff
path: root/src/signal/handler.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-19 10:38:11 +0000
committer_ov4 <ov4@ov4.org>2026-10-19 10:38:11 +0000
commit75c3db6a55685361ac54f6d7f7f795729f50152f (patch)
treefb29a22256d410fb78236b9ae8293e434915250c /src/signal/handler.cc
parentc23e61b4455cee8669c7d594478a4238048f032f (diff)
adapt selfpipe and signal process to sigchld handler
Diffstat (limited to 'src/signal/handler.cc')
-rw-r--r--src/signal/handler.cc32
1 files changed, 32 insertions, 0 deletions
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 <print>
+#include <signal.h>
+#include <cstdio>
+
+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