Stdio buffering question

Doug Gwyn gwyn at brl-smoke.ARPA
Fri Jun 10 10:02:05 AEST 1988


In article <16124 at brl-adm.ARPA> ultra!wayne at ames.arc.nasa.gov (Wayne Hathaway) writes:
>I mean, if it doesn't buffer when writing to the terminal, why does
>it buffer when writing to a pipe?

People keep dorking around with stdio buffering in an attempt to be
"helpful".  As usual, it just messes things up in some cases.

stderr is supposed to start out unbuffered, ALWAYS.  It doesn't,
though, on SunOS.  A way to fix this is to setbuf(stderr,(char*)0);
at the beginning of your program.



More information about the Comp.unix.wizards mailing list