1TTY(4) Linux Programmer's Manual TTY(4)
2
3
4
6 tty - controlling terminal
7
9 The file /dev/tty is a character file with major number 5 and minor
10 number 0, usually of mode 0666 and owner.group root.tty. It is a syn‐
11 onym for the controlling terminal of a process, if any.
12
13 In addition to the ioctl() requests supported by the device that tty
14 refers to, the ioctl() request TIOCNOTTY is supported.
15
16 TIOCNOTTY
17 Detach the current process from its controlling terminal.
18
19 If the process is the session leader, then SIGHUP and SIGCONT signals
20 are sent to the foreground process group and all processes in the cur‐
21 rent session lose their controlling tty.
22
23 This ioctl() call only works on file descriptors connected to /dev/tty.
24 It is used by daemon processes when they are invoked by a user at a
25 terminal. The process attempts to open /dev/tty. If the open succeeds,
26 it detaches itself from the terminal by using TIOCNOTTY, while if the
27 open fails, it is obviously not attached to a terminal and does not
28 need to detach itself.
29
31 /dev/tty
32
34 chown(1), mknod(1), ioctl(2), termios(3), console(4), ttyS(4),
35 mingetty(8)
36
37
38
39Linux 2003-04-07 TTY(4)