Detailing information with the SA_SIGINFO

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 ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.