runInteractiveProcess and buffering

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


On 10/13/07, Henning Thielemann <lemming at henning-thielemann.de> 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).


AGL

-- 
Adam Langley                                      agl at imperialviolet.org
http://www.imperialviolet.org                       650-283-9641


More information about the Libraries mailing list