Saturday, April 13, 2013

Signals

SIGABRT - sent by abort() to its calling process.  The process terminates and generates a core dump.  assert() call abort() when the condition fails.

SIGALRM - sent by alarm() and setitimer() when the period has lapsed to the calling process.

SIGBUS - rasied by kernel when the process incurs a hardware fault other than memory protection, usually a irrecoverable errors such as unaligned memory access.

SIGCHLD - sent to the parent process when a process ends.  Parent process issues a wait().

SIGCONT - sent to the process that resumed from stop.  Usually caught by terminal or editor use to refresh screen.

SIGFPE - cover not just floating point exception but all arithmetic exception

SIGHUP - kernel sends to the session leader when the terminal disconnects.  The kernel also send to all foreground processes when the session leader terminates.  The default action is to terminate.  This signal means the user has logged out.  Daemon overloads this signal to instruct them to reload its configuration.  As daemon has no control terminal, it should never receive this signal from other sources.

SIGILL - sent when process execute an illegal instruction.  Process can catch this signal but the behaviour is undefined.

SIGINT - sent to all foreground processes when user presses the interrupt key (CTL-C).  This allow the processes to clean up before terminating.

SIGIO - BSD style asynchronous I/O event

SIGKILL - sent from the kill() system call.  It cannot be caught or ignored.

SIGPIPE - If a process write to a queue but the reader has terminated, kernel raised this signal.

SIGPROF - raised by setitimer() with the ITIMER_PROF flag when the profile timer expires.

SIGPWR - system dependent.  A UPS monitoring process sends this signal to init when the the battery level is low to allow the system to shut down orderly.

SIGQUIT - sent to all foreground processes when user presses the quit key (CTL-\)

SIGSEGV - sent when process access an invalid memory address (segmentation violation)

SIGSTOP - sent by kill() system call.  This cannot be caught or ignored.  The process is unconditionally stopped.

SIGSYS - process executes an illegal system call.  For example, code compiled with newer version of OS runs on an older version.

SIGTERM - sent by kill().  Allows a process to catch it to initiate an oerderly termination.

SIGTRAP - sent when process cross a breakpoint, generally caught by debugger and ignored by most other processes.

SIGTSTP - sent by kernel to foreground process when user press suspend key (CTL-Z)

SIGTTIN/SIGTTOU - sent to a background process when it attempts to read from/write to control terminal.

SIGURG - kernel sends to process when an out-of-band data arrived at a socket

SIGURS1/2 - used solely by user processes.  Common use is to instruct daemon to change behaviour

SIGVTALRM - raised by setitimer() when timer created with ITIMER_VIRTUAL flag expires

SIGWINCH - sent by kernel to all foreground processes when the terminal window size changes

SIGXCPU/SIGXFSZ - riased by kernel when the CPU and file size limit reached.


No comments: