136 lines
3.2 KiB
HTML
136 lines
3.2 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of TTY</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>TTY</H1>
|
|
Section: Linux Programmer's Manual (4)<BR>Updated: 2019-03-06<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
tty - controlling terminal
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The file
|
|
<I>/dev/tty</I>
|
|
|
|
is a character file with major number 5 and
|
|
minor number 0, usually with mode 0666 and ownership root:tty.
|
|
It is a synonym for the controlling terminal of a process, if any.
|
|
<P>
|
|
|
|
In addition to the
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioctl">ioctl</A></B>(2)
|
|
|
|
requests supported by the device that
|
|
<B>tty</B>
|
|
|
|
refers to, the
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioctl">ioctl</A></B>(2)
|
|
|
|
request
|
|
<B>TIOCNOTTY</B>
|
|
|
|
is supported.
|
|
<A NAME="lbAD"> </A>
|
|
<H3>TIOCNOTTY</H3>
|
|
|
|
Detach the calling process from its controlling terminal.
|
|
<P>
|
|
|
|
If the process is the session leader,
|
|
then
|
|
<B>SIGHUP</B>
|
|
|
|
and
|
|
<B>SIGCONT</B>
|
|
|
|
signals are sent to the foreground process group
|
|
and all processes in the current session lose their controlling tty.
|
|
<P>
|
|
|
|
This
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioctl">ioctl</A></B>(2)
|
|
|
|
call works only on file descriptors connected
|
|
to
|
|
<I>/dev/tty</I>.
|
|
|
|
It is used by daemon processes when they are invoked
|
|
by a user at a terminal.
|
|
The process attempts to open
|
|
<I>/dev/tty</I>.
|
|
|
|
If the open succeeds, it
|
|
detaches itself from the terminal by using
|
|
<B>TIOCNOTTY</B>,
|
|
|
|
while if the
|
|
open fails, it is obviously not attached to a terminal and does not need
|
|
to detach itself.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<I>/dev/tty</I>
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+chown">chown</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+mknod">mknod</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioctl">ioctl</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioctl_console">ioctl_console</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioctl_tty">ioctl_tty</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+termios">termios</A></B>(3),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?4+ttyS">ttyS</A></B>(4),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?4+vcs">vcs</A></B>(4),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+pty">pty</A></B>(7),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+agetty">agetty</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mingetty">mingetty</A></B>(8)
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DL>
|
|
<DT id="3"><A HREF="#lbAD">TIOCNOTTY</A><DD>
|
|
</DL>
|
|
<DT id="4"><A HREF="#lbAE">FILES</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
<DT id="6"><A HREF="#lbAG">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:02 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|