7.1 A signal handler

As per man 2 signal, the type of a signal handler is as follows:

typedef void (*sighandler_t)(int);  
    

This means that a signal handler has to be a function that returns void, and it needs to take an int parameter.

For example, we can write a signal handler as follows:

void handler(int i)  
{  
}  
    

Obviously, this signal handler is rather useless, but it illustrates the basics of a signal handler.