Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!indri!nic.MR.NET!thor.acc.stolaf.edu!mike From: mike@thor.acc.stolaf.edu (Mike Haertel) Newsgroups: comp.unix.wizards Subject: Re: SURVEY RESULTS: Should fd 3 be /dev/tty? Message-ID: <2014@thor.acc.stolaf.edu> Date: 6 May 89 17:36:37 GMT References: <8123@phoenix.Princeton.EDU> <172@sopwith.UUCP> Reply-To: mike@stolaf.edu Distribution: usa Organization: St. Olaf College, Northfield, MN Lines: 23 >In article <8123@phoenix.Princeton.EDU> bernsten@phoenix.Princeton.EDU (Dan Bernstein) writes: >|(3) v8/v9 already has fd 3 as /dev/tty: Why? AT&T, if you want >|to make this change, go all the way and accompany stdin, stdout, >|and stderr with cmdin. Don't make a non-redirectable file descriptor >|for what's already in the name space. v9 has a /dev/tty which is just a link to /dev/fd/3. When v9 programs need to get at the terminal, I bet they just open /dev/tty like on any other version of Unix. One good reason to implement /dev/tty this way is that /dev/tty is a pretty weird device driver with an incestuous relationship to other data structures in the kernel. /dev/fd/ has a similar problem. By implementing /dev/tty as a link to /dev/fd/3 the v9 people were able to reduce the count of ugly incestuous drivers to 1. Another advantage is that one can redirect descriptor 3 to fool programs that stupidly insist on talking to /dev/tty. With streams you can even give them a working tty ioctl interface . . . -- Mike Haertel main() ??< printf("hello, world??/n"); ??>