stdin and UNIX pipes

Doug Gwyn gwyn at smoke.brl.mil
Thu Feb 21 09:52:29 AEST 1991


In article <1991Feb20.210406.21117 at csrd.uiuc.edu> bliss at sp64.csrd.uiuc.edu (Brian Bliss) writes:
>saying
>  fopen ("/dev/tty", "r");
>always opens the screen for input, regardless of the state of stdin.

Wrong, although close for most UNIX implementations.

>obvoulsy, somewhere (in libc.a?) there is code to check for the
>string "/dev/tty", and open /dev/tty/tty?? instead of trying
>to open the directory /dev/tty.

Wrong again.  Usually on UNIX "/dev/tty" is the name of a "character
special file" that has no obvious connection to the other terminal
device names nor the kernel support for them.  The kernel knows how
to handle /dev/tty and does so.  This should be documented in your
UNIX Programmer's (or Administrator's) Reference Manual under TTY(4)
or TTY(7).



More information about the Comp.lang.c mailing list