sigaction
The following program demonstrates the use of the sigaction
sysmtem call to (almost) emulate the signal
system call. (libc's wrapper for signal will also arrange to
restart interrupted system calls.) The program is an infinite loop that
catches the SIGINT signal.
sigaction.c