摘要:
signal (SIGPIPE, SIG_IGN); 阅读全文
摘要:
#include <stdio.h>#include <signal.h>#include <unistd.h>void show_handler(int sig){ printf("I got signal %d\n", sig); int i; for(i = 0; i < 5; i++) { printf("i = %d\n", i); sleep(1); }}int main(void){ int i = 0; struct sigaction act, oldact; act.sa_handler = 阅读全文