Blob
1 #include <unistd.h>2 #include <signal.h>3 #include <string.h>4 #include <stdio.h>6 void handle_signal (int sig)7 {8 printf ("Signal: %d\n", sig);9 }11 int main (void)12 {13 struct sigaction act;15 memset (&act, 0, sizeof (act));16 act.sa_handler = handle_signal;17 sigaction (SIGINT, &act, NULL);19 for (int i = 0; i < 3; ++i) {20 puts ("sleeping...");21 sleep (5);22 }23 }