Manual page for TTY(4)
tty - controlling terminal interface
DESCRIPTION
The file
/dev/tty
is, in each process, a synonym for the controlling
terminal of that process, if any.
It is useful for programs or shell sequences that wish to be sure of
writing messages on the terminal no matter how output has been redirected.
It can also be used for programs that demand the name of a file for output,
when typed output is desired and it is tiresome to find out what terminal
is currently in use.
IOCTLS
In addition to the
ioctl()
requests supported by the device that
tty
refers to, the following
ioctl()
request
is supported:
- TIOCNOTTY
-
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
ioctl()
call only works on file descriptors connected to
/dev/tty;
this is used by daemon processes when they are invoked by a user at
a terminal. The process attempts to open
/dev/tty;
if the open succeeds, it detaches itself from the terminal by using
TIOCNOTTY,
while if the open fails, it is obviously not attached to a terminal
and does not need to detach itself.
FILES
- /dev/tty
-
SEE ALSO
termio.4
Created by unroff & hp-tools.
© somebody (See intro for details). All Rights Reserved.
Last modified 11/5/97