A process can ignore a signal by setting up the return value to SIG_IGN. Here the process would always be ignored by the handler. For e.g. :-
#include <stdio.h> #include <unistd.h> #include <signal.h> void ouch(int sig) { printf("OUCH! - I got signal %d\n", sig); (void) signal(SIGINT, SIG_IGN); } int main() { (void) signal(SIGINT, ouch);
while(1) { printf("Hello World!\n"); sleep(1); } } Here the SIGINT signal would be ignored, whenever we press it the system would ignore it, and it would result an infinite loop of Hello World.