摘要: 代码: 1 #include 2 #include 3 #include 4 5 int ctrl_c_count = 0; 6 void (*old_handler) (INT); 7 void ctrl_c(int signum) 8 { 9 (void)signal(SIGINT,ctrl_c);10 ++ctrl_c_count;11 }12 13 main()14 {15 int c;16 old_handler = signal(SIGINT,ctrl_c);17 while((c=getcha... 阅读全文
posted @ 2013-06-26 15:17 bob-ding 阅读(411) 评论(0) 推荐(0)
摘要: 代码取自《深入Linux设备驱动程序内核机制》7.7 7.8app 代码如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 #define DEVFILE "/dev/fa_dev" 9 static unsigned long eflag = 1;10 11 static void sigio_handler(int sigio)12 {13 printf("Get the SIGIO signal,we exit the application!\n"); 阅读全文
posted @ 2013-06-26 13:55 bob-ding 阅读(271) 评论(0) 推荐(0)