.\" Copyright (c) 1993 Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de), Fri Apr 2 11:32:09 MET DST 1993 .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, .\" USA. .\" .\" Modified Sat Jul 24 17:02:24 1993 by Rik Faith (faith@cs.unc.edu) .TH TTY 4 "January 21, 1992" "Linux" "Linux Programmer's Manual" .SH NAME tty \- controlling terminal .SH DESCRIPTION The file \fB/dev/tty\fP is a character file with major number 5 and minor number 0, usually of mode 0666 and owner root.tty. It is a synonym for the controlling terminal of a process, if any. .LP In addition to the \fBioctl()\fP requests supported by the device that \fBtty\fP refers to, the following \fBioctl()\fP request is supported: .IP \fBTIOCNOTTY\fP Detach the current process from its controlling terminal, and remove it from its current process group, without attaching it to a new process group (that is, set its process group ID to zero). This \fBioctl()\fP call only works on file descriptors connected to \fB/dev/tty\fP; this is used by daemon processes when they are invoked by a user at a terminal. The process attempts to open \fB/dev/tty\fP; if the open succeeds, it detaches itself from the terminal by using \fBTIOCNOTTY\fP, while if the open fails, it is obviously not attached to a terminal and does not need to detach itself. .SH FILES /dev/tty .SH "SEE ALSO" .BR mknod "(1), " chown "(1), " getty "(1), " termios "(2), " .BR console "(4), " ttys (4)