p9.6.c
来自「《linux编程技术详解》 linux编程入门的好书」· C语言 代码 · 共 27 行
C
27 行
#include <stdio.h>#include <unistd.h>#include <signal.h>void sigusr1(int sig){ printf("got the SIGUSR1 signal...\n"); exit(0);}int main(void){ if(signal(SIGINT,SIG_IGN)==SIG_ERR){ perror("cannot reset the SIGINT signal handler"); return 1; } if(signal(SIGUSR1,sigusr1)==SIG_ERR){ perror("cannot reset the SIGUSR1 signal handler"); return 1; } pause(); return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?