Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: stdin and UNIX pipes Message-ID: <15269@smoke.brl.mil> Date: 20 Feb 91 22:52:29 GMT References: <92993@unix.cis.pitt.edu> <1991Feb20.210406.21117@csrd.uiuc.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 17 In article <1991Feb20.210406.21117@csrd.uiuc.edu> bliss@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).