stdio buffering considered harmful

gwyn at brl-vld gwyn at brl-vld
Sat Aug 13 14:07:13 AEST 1983


From:      Doug Gwyn (VLD/VMB) <gwyn at brl-vld>

Your approach certainly seems to assume the least about the details of
any particular STDIO package's buffering algorithm, although it entails
a lot of effort on the part of the programmer (which I find acceptable,
but others haven't).

HOWEVER, some brain-damaged STDIO packages will not let you buffer more
than a line at a time to terminals (and maybe pipes) even via setbuf().
Your suggestions still work in such a case, and that is the best one
could hope for given that STDIO implementation.  It is a pity, though,
that one can't buffer up a screenload of output to a terminal when he is
already taking such pains to setbuf() and fflush() appropriately.

It might be useful for you to re-post your memo on the subject, for
those who haven't been receiving this list very long.



More information about the Comp.unix.wizards mailing list