5 /* This flag controls termination of the main loop. */
6 volatile sig_atomic_t keep_going
= 1;
8 /* The signal handler just clears the flag and re-enables itself. */
13 signal (sig
, catch_alarm
);
19 puts ("Doing stuff while waiting for alarm....");
25 /* Establish a handler for SIGALRM signals. */
26 signal (SIGALRM
, catch_alarm
);
28 /* Set an alarm to go off in a little while. */
31 /* Check the flag once in a while to see when to quit. */