摘要: signal (SIGPIPE, SIG_IGN); 阅读全文
posted @ 2012-02-19 22:36 greencolor 阅读(157) 评论(0) 推荐(0) 编辑
摘要: #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 = 阅读全文
posted @ 2012-02-19 20:32 greencolor 阅读(147) 评论(0) 推荐(0) 编辑