# man > TTY(4)

[TTY(4)](https://www.chedong.com/phpMan.php/man/TTY/4/markdown)                                Linux Programmer's Manual                               [TTY(4)](https://www.chedong.com/phpMan.php/man/TTY/4/markdown)



## NAME
       tty - controlling terminal

## DESCRIPTION
       The  file  _/dev/tty_  is a character file with major number 5 and minor number 0, usually with
       mode 0666 and ownership root:tty.  It is a synonym for the controlling terminal of a process,
       if any.

       In addition to the [**ioctl**(2)](https://www.chedong.com/phpMan.php/man/ioctl/2/markdown) requests supported by the device that **tty** refers to, the [**ioctl**(2)](https://www.chedong.com/phpMan.php/man/ioctl/2/markdown)
       request **TIOCNOTTY** is supported.

   **TIOCNOTTY**
       Detach the calling process from its controlling terminal.

       If the process is the session leader, then **SIGHUP** and **SIGCONT** signals are sent to  the  fore‐
       ground process group and all processes in the current session lose their controlling tty.

       This  [**ioctl**(2)](https://www.chedong.com/phpMan.php/man/ioctl/2/markdown) call works only on file descriptors connected to _/dev/tty_.  It is used by dae‐
       mon processes when they are invoked by a user at a terminal.  The process  attempts  to  open
       _/dev/tty_.   If  the  open  succeeds, it detaches itself from the terminal by using **TIOCNOTTY**,
       while if the open fails, it is obviously not attached to a terminal and does not need to  de‐
       tach itself.

## FILES
       _/dev/tty_

## SEE ALSO
       [**chown**(1)](https://www.chedong.com/phpMan.php/man/chown/1/markdown),  [**mknod**(1)](https://www.chedong.com/phpMan.php/man/mknod/1/markdown),  [**ioctl**(2)](https://www.chedong.com/phpMan.php/man/ioctl/2/markdown),  **ioctl**___**[console**(2)](https://www.chedong.com/phpMan.php/man/console/2/markdown), **ioctl**___**[tty**(2)](https://www.chedong.com/phpMan.php/man/tty/2/markdown), [**termios**(3)](https://www.chedong.com/phpMan.php/man/termios/3/markdown), [**ttyS**(4)](https://www.chedong.com/phpMan.php/man/ttyS/4/markdown), [**vcs**(4)](https://www.chedong.com/phpMan.php/man/vcs/4/markdown),
       [**pty**(7)](https://www.chedong.com/phpMan.php/man/pty/7/markdown), [**agetty**(8)](https://www.chedong.com/phpMan.php/man/agetty/8/markdown), [**mingetty**(8)](https://www.chedong.com/phpMan.php/man/mingetty/8/markdown)

## COLOPHON
       This page is part of release 5.10 of the Linux  _man-pages_  project.   A  description  of  the
       project,  information about reporting bugs, and the latest version of this page, can be found
       at <https://www.kernel.org/doc/man-pages/>.



Linux                                        2019-03-06                                       [TTY(4)](https://www.chedong.com/phpMan.php/man/TTY/4/markdown)
