日期:2014-05-16 浏览次数:20693 次
#include<stdio.h> #include<signal.h> #include<unistd.h> void Printf(int signo) { printf("received sigint\n"); } void ALrm(int signo) { printf("received Alrm"); } int main() { signal(SIGINT,Printf); alarm(10); signal(SIGALRM,ALrm); for(;;) pause(); return 0; }