Let's recall the very first member of the sigaction structure we saw in the previous, Chapter 11, Signaling - Part I, The sigaction structure section; it's a function pointer, and it specifies the signal handler:
struct sigaction { /* Signal handler. */#ifdef __USE_POSIX199309 union { /* Used if SA_SIGINFO is not set. */ __sighandler_t sa_handler; /* Used if SA_SIGINFO is set. */ void (*sa_sigaction) (int, siginfo_t *, void *); } __sigaction_handler;# define sa_handler __sigaction_handler.sa_handler# define sa_sigaction __sigaction_handler.sa_sigaction#else __sighandler_t sa_handler;#endif--snip-- };
The preceding highlighted code highlights the fact that as it's in a union, the signal handler can ...