Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!necntc!ima!haddock!karl
From: karl@haddock.ISC.COM (Karl Heuer)
Newsgroups: comp.lang.c
Subject: Re: Closing stdout
Message-ID: <1905@haddock.ISC.COM>
Date: Tue, 8-Dec-87 12:34:18 EST
Article-I.D.: haddock.1905
Posted: Tue Dec  8 12:34:18 1987
Date-Received: Sun, 13-Dec-87 11:59:55 EST
References: <10699@brl-adm.ARPA>
Reply-To: karl@haddock.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Boston
Lines: 14
Summary: K&P's comment doesn't apply

In article <10699@brl-adm.ARPA> LEYON_C%DICKINSN.BITNET@CUNYVM.CUNY.EDU (Leyon, Chris) writes:
>[K&P says that] "/dev/tty is opened with mode 2 -- read and write -- and then
>dup'ed to form the standard input and output.  This is actually how the
>system assembles the standard input, output and error when you log in.
>Therefore, your standard input is writable"

In this context, "standard input" means file descriptor 0, rather than the
stdio stream named "stdin".  The latter is *not* writable.  (For some reason,
stderr is often a RW stream, though.)

Moreover, K&P are talking about the *initial* standard input (your terminal).
The alleged bug occurs even if it has been redirected to a file.

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint