Contents
What is the controlling terminal?
Controlling terminal. A terminal that is associated with a session. Each session can have at most one controlling terminal associated with it, and a controlling terminal can be associated with at most one session.
Is console a terminal?
The term terminal can also refer to a device that allows users to interact with computers, typically via a keyboard and display. A console is a physical terminal that is the primary terminal that is directly connected to a machine. The console is recognized by the operating system as a (kernel-implemented) terminal.
Where does the controlling terminal of a process come from?
28.2 Controlling Terminal of a Process. One of the attributes of a process is its controlling terminal. Child processes created with fork inherit the controlling terminal from their parent process. In this way, all the processes in a session inherit the controlling terminal from the session leader.
How to detach the calling process from its controlling terminal?
Detach the calling process from its controlling terminal. If the process is the session leader, then SIGHUP and SIGCONT signals are sent to the foreground process group and all processes in the current session lose their controlling tty. This ioctl (2) call only works on file descriptors connected to /dev/tty.
What is the difference between a process and a session?
A session contains a number of process groups, and a process group contains a number of processes, and a process contains a number of threads. A session can have a controlling tty.
Which is the foreground process group in a session?
At most one process group in a session can be a foreground process group. An interrupt character typed on a tty (“Teletype”, i.e., terminal) causes a signal to be sent to all members of the foreground process group in the session (if any) that has that tty as controlling tty.