Function nc::tgkill[][src]

pub fn tgkill(tgid: i32, tid: i32, sig: i32) -> Result<(), Errno>
Expand description

Send a signal to a thread.

let ret = nc::fork();
assert!(ret.is_ok());
let pid = ret.unwrap();
if pid == 0 {
    println!("[child] pid: {}", nc::getpid());
    let _ret = nc::pause();
} else {
    let ret = nc::tgkill(pid, pid, nc::SIGTERM);
    assert!(ret.is_ok());
}