2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright (c) 1993 Michael Haardt (michael@moria.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., 59 Temple Place, Suite 330, Boston, MA 02111,
|
|
|
|
.\" USA.
|
|
|
|
.\"
|
|
|
|
.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
|
|
|
|
.\" Modified 2003-04-07 by Michael Kerrisk
|
|
|
|
.\"
|
|
|
|
.TH TTY 4 2003-04-07 "Linux" "Linux Programmer's Manual"
|
|
|
|
.SH NAME
|
|
|
|
tty \- controlling terminal
|
|
|
|
.SH DESCRIPTION
|
2005-11-02 13:55:25 +00:00
|
|
|
The file \fI/dev/tty\fP is a character file with major number 5 and
|
2004-11-03 13:51:07 +00:00
|
|
|
minor number 0, usually of mode 0666 and owner.group root.tty. It is a
|
|
|
|
synonym for the controlling terminal of a process, if any.
|
|
|
|
.LP
|
2005-10-19 07:07:02 +00:00
|
|
|
In addition to the \fBioctl\fP() requests supported by the device that
|
|
|
|
\fBtty\fP refers to, the \fBioctl\fP() request \fBTIOCNOTTY\fP is supported.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SS TIOCNOTTY
|
|
|
|
Detach the current process from its controlling terminal.
|
|
|
|
.sp
|
|
|
|
If the process is the session leader,
|
|
|
|
then SIGHUP and SIGCONT signals are sent to the foreground process group
|
|
|
|
and all processes in the current session lose their controlling tty.
|
|
|
|
.sp
|
2005-10-19 07:07:02 +00:00
|
|
|
This \fBioctl\fP() call only works on file descriptors connected
|
2005-11-02 13:55:25 +00:00
|
|
|
to \fI/dev/tty\fP. It is used by daemon processes when they are invoked
|
2004-11-03 13:51:07 +00:00
|
|
|
by a user at a terminal.
|
2005-11-02 13:55:25 +00:00
|
|
|
The process attempts to open \fI/dev/tty\fP. If the open succeeds, it
|
2004-11-03 13:51:07 +00:00
|
|
|
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 chown (1),
|
|
|
|
.BR getty (1),
|
|
|
|
.BR mknod (1),
|
|
|
|
.BR ioctl (2),
|
|
|
|
.BR termios (3),
|
|
|
|
.BR console (4),
|
2005-05-11 14:18:48 +00:00
|
|
|
.BR ttyS (4)
|