summaryrefslogtreecommitdiff
path: root/meap/meap-code/ch10/ch10-ignore/src/main.rs
blob: 9f683629718f7898f2c90ac4865434d76f0e5c4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate libc; // 0.2.42

use libc::{signal,raise};
use libc::{SIG_DFL, SIG_IGN, SIGTERM};

fn main() {
    unsafe {
        signal(SIGTERM, SIG_IGN);
        raise(SIGTERM);
    }
    println!("ok");
    
    unsafe {
        signal(SIGTERM, SIG_DFL);
        raise(SIGTERM);
    }
    println!("not ok");
}