1TTY(4)                     Linux Programmer's Manual                    TTY(4)
2
3
4

NAME

6       tty - controlling terminal
7

DESCRIPTION

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

FILES

31       /dev/tty
32

SEE ALSO

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

COLOPHON

38       This page is part of release 5.13 of the Linux  man-pages  project.   A
39       description  of  the project, information about reporting bugs, and the
40       latest    version    of    this    page,    can     be     found     at
41       https://www.kernel.org/doc/man-pages/.
42
43
44
45Linux                             2019-03-06                            TTY(4)
Impressum