runInteractiveProcess and buffering

Adam Langley agl at
Sat Oct 13 13:29:41 EDT 2007

On 10/13/07, Henning Thielemann <lemming at> wrote:
> Is this decision done automatically by C's standard library or must the C
> programmer do this manually? I couldn't find such a switch in the C
> program.

I believe that glibc fstat's FD 1 to find out if stdout is a terminal
and sets its buffering up accordingly. The solution is to call
fflush(stdout) at the correct places in the C code, or to force the
buffering explicitly at the beginning of the program (see man setbuf).


Adam Langley                                      agl at                       650-283-9641

More information about the Libraries mailing list