/dev/tty doesn't exist?
Thomas P. Mitchell
mitch at stride1.UUCP
Wed Jan 6 06:09:31 AEST 1988
In article <167 at sdeggo.UUCP> dave at sdeggo.UUCP (David L. Smith) writes:
>In article <445 at minya.UUCP >, jc at minya.UUCP (John Chambers) writes:
> >
> > Perhaps the question could be rephrased: What is the official, approved
> > way for a daemon process like this to attach a terminal? If the answer
> > is RTFM....
It is in the manual but a bit hard to find. Try "man man" and
look for an option "man -f something". Keep the 'something'
simple because a simple minded grep is done on the man page
headers.
Here is part of the result of "man -f tty" on this system. Note
that two 'tty' man pages exist.
getty (8) - set terminal type, modes, speed, and line discipline
stty (1) - set the options for a terminal
tty (1) - get the name of the terminal
tty (4) - controlling terminal interface
>The problem would seem to be that /dev/tty has no idea what tty you really
>want to be talking to. In order to set things up, you need to do a
>setpgrp() and then open the terminal you wish to talk to. Termio(7) briefly
>explains about the control terminal.
>
It (/dev/tty) is a clever pseudo device. The key is that it
figures out which "real" device the process is connected to.
======== man page follows ======= this system's "man 4 tty" ===
NAME
tty - controlling terminal interface
DESCRIPTION
The file /dev/tty is, in each process, a synonym for the
control terminal associated with the process group 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.
FILES
/dev/tty
/dev/tty*
Thomas P. Mitchell (mitch at stride1.Stride.COM)
Phone: (702) 322-6868 TWX: 910-395-6073
MicroSage Computer Systems Inc. a Division of Stride Micro.
Opinions expressed are probably mine.
More information about the Comp.unix.wizards
mailing list