summaryrefslogtreecommitdiff
path: root/init/src/signals/sigchld.rs
blob: 78b72d43a64ef00e29407c34fa827251a9354504 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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; 
        }
    }

}