]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man4/tty.4
Formatted signal names
[thirdparty/man-pages.git] / man4 / tty.4
CommitLineData
fea681da
MK
1.\" Copyright (c) 1993 Michael Haardt (michael@moria.de), Fri Apr 2 11:32:09 MET DST 1993
2.\"
3.\" This is free documentation; you can redistribute it and/or
4.\" modify it under the terms of the GNU General Public License as
5.\" published by the Free Software Foundation; either version 2 of
6.\" the License, or (at your option) any later version.
7.\"
8.\" The GNU General Public License's references to "object code"
9.\" and "executables" are to be interpreted as the output of any
10.\" document formatting or typesetting system, including
11.\" intermediate and printed output.
12.\"
13.\" This manual is distributed in the hope that it will be useful,
14.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16.\" GNU General Public License for more details.
17.\"
18.\" You should have received a copy of the GNU General Public
19.\" License along with this manual; if not, write to the Free
20.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21.\" USA.
c13182ef 22.\"
fea681da
MK
23.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
24.\" Modified 2003-04-07 by Michael Kerrisk
25.\"
26.TH TTY 4 2003-04-07 "Linux" "Linux Programmer's Manual"
27.SH NAME
28tty \- controlling terminal
29.SH DESCRIPTION
8478ee02 30The file \fI/dev/tty\fP is a character file with major number 5 and
c13182ef
MK
31minor number 0, usually of mode 0666 and owner.group root.tty.
32It is a synonym for the controlling terminal of a process, if any.
fea681da 33.LP
60a90ecd
MK
34In addition to the
35.BR ioctl (2)
36requests supported by the device that
37\fBtty\fP refers to, the
38.BR ioctl (2)
39request \fBTIOCNOTTY\fP is supported.
fea681da
MK
40.SS TIOCNOTTY
41Detach the current process from its controlling terminal.
42.sp
43If the process is the session leader,
8bd58774
MK
44then
45.B SIGHUP
46and
47.B SIGCONT
48signals are sent to the foreground process group
fea681da
MK
49and all processes in the current session lose their controlling tty.
50.sp
60a90ecd
MK
51This
52.BR ioctl (2)
53call only works on file descriptors connected
1c44bd5b
MK
54to \fI/dev/tty\fP.
55It is used by daemon processes when they are invoked
fea681da 56by a user at a terminal.
1c44bd5b
MK
57The process attempts to open \fI/dev/tty\fP.
58If the open succeeds, it
fea681da
MK
59detaches itself from the terminal by using \fBTIOCNOTTY\fP, while if the
60open fails, it is obviously not attached to a terminal and does not need
61to detach itself.
62.SH FILES
63/dev/tty
64.SH "SEE ALSO"
65.BR chown (1),
fea681da
MK
66.BR mknod (1),
67.BR ioctl (2),
68.BR termios (3),
69.BR console (4),
27334eaf
MK
70.BR ttyS (4),
71.BR mingetty (8)