Line Buffered output

Chris Torek chris at mimsy.UUCP
Wed Oct 5 08:19:00 AEST 1988


>>In article <1613 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
>>>The problem of handling stdout and stdin is a solved
>>>problem: do a flushbuf on all interactive streams whenever you do a
>>>fillbuf on any interactive stream. ...

>In article <13765 at mimsy.UUCP> I wrote:
>>`Backwards compatibility means we get to keep all our old mistakes.'

In article <1686 at ficc.uu.net>, peter at ficc.uu.net (Peter da Silva) writes:
>But it's *Berkeley* that had the smart stdio in the first place! I know
>that I ran into this on 2.something at Berkeley in 1980 and thought it
>was way-cool. When and why was it removed, or did it just not get migrated
>to 4BSD?

I presume by `it' you mean that reading from stdin flushes stdout.
That is still there; the difference between REALLY line buffered and
fully-buffered-but-flushed-on-input can be seen with the following
program:

	main() { putchar('g'); putchar('o'); putchar('\n'); for (;;); }

2BSD and 4BSD will both print `go\n' if stdout is a terminal, while
under what I think you were proposing, you would never see anything.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.wizards mailing list