summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/src/signals/sigchld.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/init/src/signals/sigchld.rs b/init/src/signals/sigchld.rs
new file mode 100644
index 0000000..78b72d4
--- /dev/null
+++ b/init/src/signals/sigchld.rs
@@ -0,0 +1,18 @@
+use libc::{signal, sighandler_t, SIGCHILD, SIG_DFL, SIG_IGN};
+use std::ffi::c_int;
+
+fn sigchild_handler(_signal: c_int) {
+ loop {
+ let mut status: c_int = 0;
+ ket pid: pid_t = unsafe {
+ waitpid(-1 , &mut status, WNOHANG)
+ };
+
+ if pid <= 0 {
+ break;
+ }
+ }
+
+}
+
+