Catch SIGINT


The following program shows how to use the signal system call to establish a signal handler for a signal (here, the SIGINT signal, which corresponds to typing CTRL-C at the terminal).

The complete source code and Makefile is available as a zip file.

catch-sigint.c