aboutsummaryrefslogtreecommitdiff
path: root/src/signal/handler.cc
diff options
context:
space:
mode:
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