]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man4/tty.4
Convert function formatting of the form "\fBname\fP()" to ".BR name ()".
[thirdparty/man-pages.git] / man4 / tty.4
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.
22 .\"
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
28 tty \- controlling terminal
29 .SH DESCRIPTION
30 The file \fI/dev/tty\fP is a character file with major number 5 and
31 minor number 0, usually of mode 0666 and owner.group root.tty.
32 It is a synonym for the controlling terminal of a process, if any.
33 .LP
34 In addition to the
35 .BR ioctl (2)
36 requests supported by the device that
37 \fBtty\fP refers to, the
38 .BR ioctl (2)
39 request \fBTIOCNOTTY\fP is supported.
40 .SS TIOCNOTTY
41 Detach the current process from its controlling terminal.
42 .sp
43 If the process is the session leader,
44 then SIGHUP and SIGCONT signals are sent to the foreground process group
45 and all processes in the current session lose their controlling tty.
46 .sp
47 This
48 .BR ioctl (2)
49 call only works on file descriptors connected
50 to \fI/dev/tty\fP.
51 It is used by daemon processes when they are invoked
52 by a user at a terminal.
53 The process attempts to open \fI/dev/tty\fP.
54 If the open succeeds, it
55 detaches itself from the terminal by using \fBTIOCNOTTY\fP, while if the
56 open fails, it is obviously not attached to a terminal and does not need
57 to detach itself.
58 .SH FILES
59 /dev/tty
60 .SH "SEE ALSO"
61 .BR chown (1),
62 .BR mknod (1),
63 .BR ioctl (2),
64 .BR termios (3),
65 .BR console (4),
66 .BR ttyS (4),
67 .BR mingetty (8)