创建注册信号处理器 Posted on 2014-12-03 In c-lang 创建注册信号处理器 #include <signal.h> int catch_signal(int sig, void (*handler) (int)) { struct sigaction action; action.sa_handler = handler; sigemptyset(&action.sa_mask); action.sa_flags = 0; return sigaction (sig, &action, NULL); }