Info

struct k_sigaction {

struct sigaction sa;

If no user-defined handler routine is installed for a signal (this means that the default routine is used instead), the sa.sa_handler flag is set to sig_dfl. In this case, the kernel performs one of four standard actions depending on the signal type:

□ Terminate — Terminates the process or process group.

□ Stop — Places the process in the task_stopped state.

□ Core Dump — Creates a core dump of the address space and writes it to a core file for processing, for example, by a debugger.

13Signal handlers that use this stack must be installed using the SA_ONSTACK flag. Since this mechanism is rarely used, I will not bother discussing it here.

Table 5-2 shows which signals are assigned to which default handler. The corresponding information can be obtained from the macros sig_kernel_only_mask, sig_kernel_coredump_

MASK, SIG_KERNEL_IGNORE_MASK, and SIG_KERNEL_STOP_MASK in <signal.h>.

Table 5-2: Default Actions for Standard Signals

Action

Signals

Ignore

SIGCONT, SIGCHLD, SIGWINCH, SIGURG

Terminate

SIGHUP, S IG INT, SIGKILL, SIGUSR1, SIGUSR2, SIGALRM, SIGTERM, SIGVTALRM, SIGPROF, SIGPOLL, SIGIO, SIGPWR and all real-time signals.

Stop

SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU

Core dump

SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGSEGV, SIGXCPU, SIGXFSZ, SIGSYS, SIGXCPU, SIGEMT

All blocked signals are defined by the blocked element of the task structure. The sigset_t data type used is a bitmask that must contain (at least) as many positions as the number of signals supported. For this purpose, the kernel uses an array of unsigned longs whose size is calculated on the basis of _nsig and _nsig_bpw (bits per word).

Continue reading here: Info

Was this article helpful?

0 0