On
POSIX-compliant platforms,
SIGTTIN is the
signal thrown by
computer programs that attempt to read from the
tty while in the background. The
symbolic constant for SIGTTIN is defined in the
header file signal.h. Symbolic signal names are used because signal numbers can vary across platforms.
Etymology
SIG is a common
prefix for signal names.
TT is for
tty, an abbreviation for
teletypewriter, an archaic type of
computer terminal.
IN refers to
input.
Usage
SIGTTIN may be sent to a background process that attempts to read from its controlling terminal. In practical terms this controlling terminal is usually an interactive terminal session at which the user initiated the background job.
The default action of SIGTTIN is to stop the process. Background processes thus suspended can be placed into the foreground to accept input by the shell using the fg command or by sending them the SIGCONT signal.
The SIGTTIN signal provides an alternative to this reliance on human interaction. On receiving the SIGTTIN, for instance, an appropriately coded program may opt to perform a default action rather than waiting for a human user to foreground it and respond.
Typically this signal applies to processes under job control; daemons do not have controlling terminals and should never receive this signal.
See also
- SIGTTOU - a corresponding signal received if a background process tries to write to its controlling terminal.