I am quite new to C and I can not successfully understand the following code:
#include <signal.h> //1
typedef void (*sighandler_t)(int); //2
sighandler_t signal (int signo, sighandler_t handler); //3
Line 3 is:
signal is a function that takes 2 arguments, one being an integer and the other being a sighandler_t and returns a sighandler_t?
But what is sighandler_t?
Is it a pointer to a function, where the function that is being pointed is a function that takes an argument of type int and returns void?
Can you give an example on how I can use it?