devtty(7) DG/UX 4.30 devtty(7)
NAME
devtty - control terminal pseudo-device
DESCRIPTION
The file /dev/tty is, in each process, a synonym for the
control terminal associated with that process. The file is
useful if you want a program to write messages on the
terminal no matter how output has been redirected. You can
also use it when a program needs a filename for output and
you do not want to find out which terminal is currently in
use.
If a process that has no control terminal opens a terminal
file, the terminal becomes the control terminal for that
process. The control terminal is thereafter inherited by a
child process during a fork(2) system call, even if the
control terminal is closed.
All operations on /dev/tty behave like operations on the
actual control terminal special file (/dev/tty*), except for
the special ioctl TIOCNOTTY, which is recognized only on the
/dev/tty device:
ioctl(fildes, TIOCNOTTY, 0);
TIOCNOTTY breaks the association of a process with its
control terminal, and also sets the process group of the
calling process to the process id of that process. Further
I/O requests to the file will fail with the external
variable errno set to ENXIO. Subsequent opens of /dev/tty
will also fail with errno set to ENXIO.
FILES
/dev/tty
SEE ALSO
termio(7), tty(7).
Licensed material--property of copyright holder(s) Page 1