1tty(4) Kernel Interfaces 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 with mode 0666 and ownership root:tty. It is a syn‐
11 onym for the controlling terminal of a process, if any.
12
13 In addition to the ioctl(2) requests supported by the device that tty
14 refers to, the ioctl(2) request TIOCNOTTY is supported.
15
16 TIOCNOTTY
17 Detach the calling 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(2) call works only on file descriptors connected to
24 /dev/tty. It is used by daemon processes when they are invoked by a
25 user at a terminal. The process attempts to open /dev/tty. If the
26 open succeeds, it detaches itself from the terminal by using TIOCNOTTY,
27 while if the open fails, it is obviously not attached to a terminal and
28 does not need to detach itself.
29
31 /dev/tty
32
34 chown(1), mknod(1), ioctl(2), ioctl_console(2), ioctl_tty(2),
35 termios(3), ttyS(4), vcs(4), pty(7), agetty(8), mingetty(8)
36
37
38
39Linux man-pages 6.04 2022-10-30 tty(4)