Seth Woolley's Man Viewer

Manual for tty - man 4 tty

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

TTY(4)                     Linux Programmer's Manual                    TTY(4)

       tty(1,4) - controlling terminal

       The  file(1,n)  /dev/tty(1,4)  is  a character file(1,n) with major number 5 and minor
       number 0, usually of mode 0666 and root.tty.  It is a  syn-
       onym for the controlling terminal of a process, if(3,n) any.

       In  addition  to  the ioctl() requests supported by the device that tty(1,4)
       refers to, the ioctl() request TIOCNOTTY is supported.

       Detach the current 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(1,8) the cur-
       rent session lose their controlling tty.

       This ioctl() call only works on file(1,n) descriptors connected to /dev/tty(1,4).
       It  is  used  by  daemon processes when they are invoked by a user at a
       terminal.  The process attempts to open(2,3,n) /dev/tty(1,4). If the open(2,3,n) succeeds,
       it  detaches  itself from the terminal by using TIOCNOTTY, while if(3,n) the
       open(2,3,n) fails, it is obviously not attached to a  terminal  and  does  not
       need to detach itself.


       chown(1,2)(1), getty(1), mknod(1,2)(1), ioctl(2), termios(3), console(4,n)(4), ttys(4)

Linux                             2003-04-07                            TTY(4)

References for this manual (incoming links)