Signal (Unix)

from Wikipedia, the free encyclopedia

When using the Unix operating system , a signal is a system message to a running process . Signals are a primitive form of interprocess communication . Most signals also cause an action - usually ending the process. Others, however, are only used for information purposes (e.g. SIGWINCH) or can stop a process (SIGSTOP). There are also signals that can be freely used by the user (SIGUSR1 and SIGUSR2). Some signals can be intercepted or suppressed by the process. So catch z. B. some server programs (in Unix jargon " daemon ") SIGUSR1 or SIGUSR2 and then read in their configuration files again.

Common UNIX signals

The usual signals are listed below with their numbers. The supported signals and their values ​​can differ from system to system. The POSIX.1 standard provides different numerical values ​​depending on the hardware architecture used.

The prefix SIG is the short form of Signal.

The command kill -lusually outputs all supported signal numbers with their associated names. The table below contains the following values ​​as an example:

signal Values, synonym Meaning Meaning (translated) Original usage, standards
A. B. C. D.
SIGHUP 1 Hangup detected on controlling terminal or death of controlling process Blocking of the control terminal or end of the control process . POSIX (1990)
SIGINT 2 Interrupt from keyboard; interactive attention signal. Keyboard interrupt ; interactive warning signal. C89 ; POSIX (1990)
SIGQUIT 3 Quit from keyboard. Exit through the keyboard.
SIGILL 4th Illegal instruction. Invalid instruction. C89; POSIX (1990)
SIGTRAP 5 Trace / breakpoint trap. Stop mark reached. SUSv2 ; POSIX (2001)
SIGABRT 6th Abnormal termination; abort signal from abort (3). abnormal termination . C89; POSIX (1990)
SIGIOT 6th IOT trap; abort () on a PDP11. 4.2BSD
SIGEMT - 7th - 7th
SIGBUS 10 10 7th 10 BUS error (bad memory access). BUS error ( memory access error ). 4.2BSD; SUSv2; POSIX (2001)
SIGFPE 8th "Floating-point exception": erroneous arithmetic operation. " Floating point operation exception error": incorrect arithmetic operation. C89; POSIX (1990)
SIGKILL 9 Kill, unblockable. Unblockable exit. POSIX (1990)
SIGUSR1 30th 30th 10 16 User-defined signal 1. Custom signal 1. POSIX
SIGSEGV 11 "Segmentation violation": invalid memory reference. " Protection Fault ": invalid memory reference. C89; POSIX (1990)
SIGUSR2 31 31 12 17th User-defined signal 2. Custom signal 2. POSIX
SIGPIPE 13 "Broken pipe": write to pipe with no readers. "Broken pipe ": Writing to a pipe without a recipient. POSIX (1990)
SIGALRM 14th Alarm clock timer signal: alarm (2). Alarm clock signal: Alarm (2). POSIX (1990)
SIGTERM 15th Termination request. Termination request . C89; POSIX (1990)
SIGSTKFLT - - 16 - Stack fault on coprocessor (unused). Stack error on coprocessor (not used).
SIGCHLD 20th 20th 17th 18th Child status has changed (stopped or terminated). Child status has been changed (paused or terminated). POSIX (1990)
SIGCLD 20th - - - Old System V name; child status has changed. Old System V designation; Child status has been changed. System V
SIGCONT 19th 19th 18th 25th Continue stopped process. Resume the paused process. POSIX
SIGSTOP 17th 17th 19th 23 Stop process, unblockable. Stop the process, unblockable. POSIX
SIGTSTP 18th 18th 20th 24 Stop typed at keyboard. Enter stop on the keyboard. POSIX
SIGTTIN 21st 21st 21st 26th Background read from tty. Reading from the terminal in the background POSIX
SIGTTOU 22nd 22nd 22nd 27 Background write to tty Writing on a terminal in the background. POSIX
SIGURG 16 16 23 21st Urgent condition on socket: high bandwidth data is available. Important state on socket: High bandwidth data is available. 4.2BSD; SUSv2; POSIX (2001)
SIGXCPU 24 24 24 30th CPU time limit exceeded. Processor time limit exceeded. 4.2BSD; SUSv2; POSIX (2001)
SIGXFSZ 25th 25th 25th 31 File size limit exceeded. File size limit exceeded. 4.2BSD; SUSv2; POSIX (2001)
SIGVTALRM 26th 26th 26th 28 Virtual alarm clock. Virtual alarm clock. 4.2BSD; SUSv2; POSIX (2001)
SIGPROF 27 27 27 29 Profiling alarm clock timer expired. 4.2BSD; SUSv2; POSIX (2001)
SIGWINCH - 28 28 20th Window size change. Window size changed. 4.3BSD; Sun
SIGPOLL 23 23 / - 29 / - 23 / - Pollable event occurred. A queryable event occurred. System V; SUSv2; POSIX (2001)
SIGIO 23 23 29 23 I / O now possible. I / O now possible. 4.2BSD
SIGINFO - (29) - - Status request from keyboard. Status request through the keyboard. Mac OS X
SIGLOST - (29) / - - - Unused; only on Sparc: file lock lost. Unused; only under Sparc: file lock lost.
SIGPWR - (29) 30th 19th Power failure restart. Power failure caused restart. System V
SIGSYS 12 12 31 12 Bad system call. invalid system call . System Vr4; SUSv2; POSIX (2001)
SIGUNUSED 12 - 31 / - -

In addition to the usual 31 signal numbers, newer Linux versions use up to 32 additional signals from 33 (or 34, or 35 depending on the C library) ( SIGRTMIN ) to 64 ( SIGRTMAX ) as real-time signals .


The default behavior of the programs when they receive one of the signals is one of the following:

  • Stopping (not ending) the running program.
  • Continuation of the previously stopped program.
  • Exiting the program without a memory dump.
  • End the program by writing a memory dump.
  • Ignoring the signal.

Except for SIGKILL and SIGSTOP , the signals can be "intercepted" by the program and trigger a different reaction.

See also

The Unix command kill can be used to send any signals under Unix.

Web links