The actual signal handler function is a function with void
return. The function signal
which installs new signal handles returns the previous signal handler function pointer.
The syntax of declaring function returning function pointers is pretty complex and hard to decipher (you really got to keep track of all those parentheses). It would have been easier if there was a typedef
, like it's done in Linux (from the Linux signal
manual page):
typedef void (*sighandler_t)(int); sighandler_t signal(int signum, sighandler_t handler);
Also note that the signal
function is considered deprecated in favor of sigaction
.