Is Unix stdio slow?
Edward Wang
edward at ucbarpa.Berkeley.EDU
Wed Oct 5 10:42:00 AEST 1988
In article <13853 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>. . . _doprnt
>assumes that a negative _cnt field is an error, and clobbers the
>count. Every once in a while, this results in putc scribbling all over
>memory. Fortunately, instances of this bug are rare (it requires
>mixing calls to printf and calls to putc in a particular way). This is
>fixed in 4.3BSD-tahoe, which no longer has _doprnt in Vax assembly.
Well I don't know about this, but the negative _cnt field
is as old as line buffering, before the fast putc. The old
putc depended on the negative _cnt to invoked _flsbuf
for line buffered streams (the --fp->_cnt >= 0 test always
fails so _flsbuf is always called).
But enough on this already.
More information about the Comp.unix.wizards
mailing list