#include #include #include #include void control_c(int x) { printf("you typed control c\n"); } void alarmclock(int x) { printf("Alarm went off\n"); exit(0); } int main() { int i; signal(SIGINT, control_c); signal(SIGALRM, alarmclock); alarm(10); for (i=0; 1; i+=1) { printf("%d", i); fflush(stdout); sleep(2); } }