SIGTTOU
Encyclopedia
On POSIX
POSIX
POSIX , an acronym for "Portable Operating System Interface", is a family of standards specified by the IEEE for maintaining compatibility between operating systems...

-compliant platforms, SIGTTOU is the signal
Signal (computing)
A signal is a limited form of inter-process communication used in Unix, Unix-like, and other POSIX-compliant operating systems. Essentially it is an asynchronous notification sent to a process in order to notify it of an event that occurred. When a signal is sent to a process, the operating system...

 sent to a process
Process (computing)
In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system , a process may be made up of multiple threads of execution that execute instructions concurrently.A computer program is a...

 when it attempts to write to the tty while in the background. The symbolic constant
C preprocessor
The C preprocessor is the preprocessor for the C and C++ computer programming languages. The preprocessor handles directives for source file inclusion , macro definitions , and conditional inclusion ....

 for SIGTTOU is defined in the header file
Header file
Some programming languages use header files. These files allow programmers to separate certain elements of a program's source code into reusable files. Header files commonly contain forward declarations of classes, subroutines, variables, and other identifiers...

 signal.h
Signal.h
signal.h is a header file defined in the C Standard Library to specify how a program handles signals while it executes. A signal can report some exceptional behavior within the program , or a signal can report some asynchronous event outside the program .A signal can be generated...

. Symbolic signal names are used because signal numbers can vary across platforms.

Etymology

SIG is a common prefix for signal names. TT stands for tty, an abbreviation
Abbreviation
An abbreviation is a shortened form of a word or phrase. Usually, but not always, it consists of a letter or group of letters taken from the word or phrase...

 for teletypewriter, an archaic type of computer terminal
Computer terminal
A computer terminal is an electronic or electromechanical hardware device that is used for entering data into, and displaying data from, a computer or a computing system...

. OU refers to output
Input/output
In computing, input/output, or I/O, refers to the communication between an information processing system , and the outside world, possibly a human, or another information processing system. Inputs are the signals or data received by the system, and outputs are the signals or data sent from it...

.

Usage

SIGTTOU may be sent to a background process that attempts to write to 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 SIGTTOU is to stop the process. Background processes thus suspended can be placed into the foreground to accept input by the shell
Unix shell
A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems...

 using the fg command
Fg (Unix)
fg is a job control command in Unix and Unix-like operating systems that resumes execution of a suspended process by bringing it to the foreground and thus redirecting its standard input and output streams to the user's terminal...

 or by sending them the SIGCONT
SIGCONT
On POSIX-compliant platforms, SIGCONT is the signal sent to restart a process previously paused by the SIGSTOP or SIGTSTP signal. The symbolic constant for SIGCONT is defined in the header file signal.h. Symbolic signal names are used because signal numbers can vary across platforms.-Etymology:SIG...

 signal.

The SIGTTOU signal provides an alternative to this reliance on human interaction. On receiving the SIGTTOU, for instance, an appropriately coded program may opt to perform a default action rather than waiting for a human user to foreground it and receive the output on the terminal.

In practice shells often override the default Stop action so that background jobs deliver their output to the controlling terminal by default.

See also

  • SIGTTIN
    SIGTTIN
    On POSIX-compliant platforms, SIGTTIN is the signal sent to a process when it attempts 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...

    - a corresponding signal sent to a process that tries to read from its controlling terminal.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK