October 2018
Beginner
794 pages
19h 23m
English
When you use the SA_SIGINFO signal flag and a trapped signal occurs, the kernel populates a data structure: the siginfo_t structure.
The siginfo_t structure definition (slightly simplified; there is some #if wrapping around the first few members which we need not worry about here) is shown next(It's in the header /usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h on Ubuntu and /usr/include/bits/types/siginfo_t.h on a Fedora box):
typedef struct { int si_signo; /* Signal number. */ int si_code; int si_errno; /* If non-zero, an errno value associated with this signal, as defined in <errno.h>. */ union { int _pad[__SI_PAD_SIZE]; /* kill(). */ struct { __pid_t si_pid; /* Sending process ID. */ __uid_t si_uid; /* Real ...Read now
Unlock full access