Signals, job control and pipes

Signal types

There are two categories of signals, those generated externally, such as a break from a terminal, and those generated internally (a process fault). Both types are treated identically. The file /usr/include/signal.h defines the signals that may be delivered to a process.

UNIX System V supports the following signals required by POSIX.1:

Symbolic name Signal event description
SIGABRT Abnormal termination (see abort(3C))
SIGALRM Alarm time out (see alarm(2))
SIGFPE Floating-Point Exception / Erroneous Arithmetic Operation
SIGHUP Hangup on controlling-terminal (see termios(3C))
SIGILL Illegal hardware instruction / Invalid function image
SIGINT Interactive attention - ``interrupt'' (see termios(3C))
SIGKILL Termination (cannot be caught or ignored)
SIGPIPE Write onto pipe without readers (see write(2))
SIGQUIT Interactive termination - ``quit'' (see termios(3C))
SIGSEGV Invalid memory (segmentation) reference
SIGTERM Termination
SIGUSR1 Reserved as application-defined signal 1
SIGUSR2 Reserved as application-defined signal 2

UNIX System V supports the following job control signals:

Symbolic name Signal event description
SIGCHLD Child Status Changed
SIGCONT Continue process execution
SIGSTOP Stop process execution
SIGTSTP Interactive stop (see termios(3C))
SIGTTIN Stop tty input (see termios(3C))
SIGTTOU Stop tty output (see termios(3C))

UNIX System V supports the following additional signals:

Symbolic name Signal event description
SIGBUS Bus Error
SIGEMT Emulation Trap
SIGPOLL Pollable Event (see streamio(7))
SIGPWR Power Fail / Restart
SIGSYS Bad System Call
SIGTRAP Trace / Breakpoint Trap
SIGWINCH Window Size Change
SIGXCPU CPU time limit exceeded (see getrlimit(2))
SIGXFSZ File size limit exceeded (see getrlimit(2))
SIGLWP Virtual interprocessor interrupt for the Threads Library
SIGAIO Asynchronous I/O
The signals fall into one of the following classes:

Hardware signals are derived from exceptional conditions which may occur during execution. Such signals include SIGBUS for accesses that result in hardware-related errors, SIGFPE representing floating-point and other arithmetic exceptions, SIGILL for invalid instruction execution, and SIGSEGV for addresses outside the currently assigned area of memory or for accesses that violate memory protection constraints. Other, more CPU-specific hardware signals such as SIGABRT, SIGEMT and SIGTRAP may be defined by a specific implementation.

Software signals reflect interrupts generated by user request: SIGINT for the normal interrupt signal; SIGQUIT for the more powerful quit signal that normally causes a core image to be generated; SIGHUP and SIGTERM that cause graceful process termination, either because a user has ``hung up'', or by user or program request; and SIGKILL, a more powerful termination signal that a process cannot catch or ignore. Programs may define their own asynchronous events using SIGUSR1 and SIGUSR2. Other software signals, such as SIGALRM, SIGVTALRM, SIGPROF, indicate the expiration of interval timers.

A process can request notification via the signal SIGPOLL when input or output is possible on a file descriptor, or when a ``non-blocking'' operation completes. A process may request to receive the signal SIGURG when an urgent condition arises.

A process may be ``stopped'' by a signal sent to it or the members of its process group (see ``Terminal device control'' and termios(3C)). The signal SIGSTOP is a powerful stop signal, because it cannot be caught. Other stop signals SIGTSTP, SIGTTIN and SIGTTOU are used when a user request, input request, or output request respectively is the reason for stopping the process. The signal SIGCONT is sent to a process when it is continued from a stopped state. Processes may receive notification with the signal SIGCHLD when a child process changes state, either by stopping or by terminating (see wait(2)).

Exceeding resource limits may cause signals to be generated. SIGXCPU occurs when a process nears its CPU time limit and SIGXFSZ warns that the limit on file size limit has been reached.

Three system signals, SIGLWP, SIGWAITING, and SIGAIO, are generated by the operating system for internal use by the Threads Library.

Next topic: Signal actions
Previous topic: Signals

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004