Info

typedef struct siginfo { int si_signo; int si_errno; int si_code;

union {

/* Signal-specific information struct struct struct struct struct struct

_timer;

_sigchld;

_sigfault;

_sigpoll;

□ si_signo holds the signal number.

□ si_errno has a non-zero value if the signal was raised as a result of an error; otherwise, its value is 0.

□ si_code returns detailed information on the origin of the signal; we are interested only in the distinction between user signal (si_user) and kernel-generated signal (si_kernel).

□ Additional information needed by the kernel to handle some signals is held in the _sifield union. For example, _sigfault contains the userspace address of the instruction that raised the signal.

Because a very large number of data structures are used, Figure 5-8 gives an overview of how they are interlinked.

Figure 5-8: Data structures used in signal management.

Continue reading here: Implementing Signal Handling

Was this article helpful?

0 0