Content-type: text/html
The /usr/include/signal.h file defines the signals described in the following table.
Signal | Number | Meaning |
SIGHUP | 1 | Hangup. |
SIGINT | 2 | Interrupt. |
SIGQUIT | 3 | Quit. (1) |
SIGILL | 4 | Invalid instruction (not reset when caught). (1) |
SIGTRAP | 5 | Trace trap (not reset when caught). (1) |
SIGABRT | 6 | End process (see the abort() function). (1) |
SIGEMT | 7 | EMT instruction. |
SIGFPE | 8 | Arithmetic exception, integer divide by 0 (zero), |
or floating-point exception. (1) | ||
SIGKILL | 9 | Kill (cannot be caught or ignored). |
SIGBUS | 10 | Specification exception. (1) |
SIGSEGV | 11 | Segmentation violation. (1) |
SIGSYS | 12 | Invalid parameter to system call. (1) |
SIGPIPE | 13 | Write on a pipe when there is no process to read it. |
SIGALRM | 14 | Alarm clock. |
SIGTERM | 15 | Software termination signal. |
SIGURG | 16 | Urgent condition on I/O channel. (2) |
SIGSTOP | 17 | Stop (cannot be caught or ignored). (3) |
SIGTSTP | 18 | Interactive stop. (3) |
SIGCONT | 19 | Continue the process if stopped. (4) |
SIGCHLD | 20 | To parent on child stop or exit. (2) |
SIGTTIN | 21 | Background read attempted from control terminal. (3) |
SIGTTOU | 22 | Background write attempted from control terminal. (3) |
SIGIO | 23 | Input/Output possible or completed. (2) |
SIGXCPU | 24 | CPU time limit exceeded (see the setrlimit() function). |
SIGXFSZ | 25 | File size limit exceeded (see the setrlimit() function). |
SIGVTALRM | 26 | Virtual time alarm (see the setitimer() function). |
SIGPROF | 27 | Profiling time alarm (see the setitimer() function). |
SIGWINCH | 28 | Window size change. (2) |
SIGINFO | 29 | Information request. (2) |
SIGUSR1 | 30 | User-defined signal 1. |
SIGUSR2 | 31 | User-defined signal 2. |
Notes to table:
Default action includes creating a core dump file. Default action is to ignore these signals. Default action is to stop the process receiving these signals. Default action is to restart or continue the process receiving these signals.
The three types of actions that can be associated with a signal: SIG_DFL, SIG_IGN, or a pointer to a function are described as follows: Default action: signal-specific default action.
A new signal mask is calculated and installed for the duration of the signal-catching function (or until sigprocmask() or sigsuspend() system calls are made). This mask is formed by taking the union of the process signal mask, the mask associated with the action for the signal being delivered, and a mask corresponding to the signal being delivered. The mask associated with the signal-catching function is not allowed to block those signals that cannot be ignored. This is enforced by the kernel without causing an error to be indicated. If and when the signal-catching function returns, the original signal mask is restored (modified by any sigprocmask() calls that were made since the signal-catching function was called) and the receiving process resumes execution at the point it was interrupted.
The signal-catching function can cause the process to resume in a different context by calling the longjmp() subroutine. When the longjmp() subroutine is called, the process leaves the signal stack, if it is currently on it, and restores the process signal mask to the state when the corresponding setjmp() call was made.
Once an action is installed for a specific signal, it remains installed until another action is explicitly requested (by another call to the sigaction() system call), or until one of the exec system calls is called.
If a signal action is set to a pointer to a function while the signal is pending, the signal remains pending.
When signal-catching functions are invoked asynchronously with process execution, the behavior of some of the functions defined by this standard is unspecified if they are called from a signal-catching function. The following set of functions are reentrant with respect to signals (that is, applications can invoke them, without restriction, from signal-catching functions):
_exit() | access() | alarm() | chdir() |
chmod() | chown() | close() | creat() |
dup2() | dup() | exec() | fcntl() |
fork() | fstat() | getegid() | geteuid() |
getgid() | getgroups() | getpgrp() | getpid() |
getppid() | getuid() | kill() | link() |
lseek() | mkdir() | mkfifo() | open() |
pause() | pipe() | read() | rename() |
rmdir() | setgid() | setpgrp() | setuid() |
sigaction() | sigaddset() | sigdelset() | sigfillset() |
siginitset() | sigismember() | signal() | sigpending() |
sigprocmask() | sigsuspend() | sleep() | statx() |
tcdrain() | tcflow() | tcflush() | tcgetattr() |
tcgetprgp() | tcsendbreak() | tcsetattr() | tcsetpgrp() |
time() | times() | umask() | uname() |
unlink() | ustat() | utime() | wait2() |
wait() | write() |
All other system calls should not be called from signal-catching functions since their behavior is undefined.
Functions: sigaction(2), sigblock(2), sigemptyset(3), siginterrupt(3), siglongjmp(3), sigpause(3), sigpending(2), sigprocmask(2), sigreturn(2), sigset(3), sigsetjmp(3), sigstack(2), sigsuspend(2), sigvec(2), sigwait(3) delim off