[Courses] Re: [C] A clarification on fflush(stderr)

Akkana akkana at shallowsky.com
Thu Aug 8 18:57:18 EST 2002

Laurel Fan writes:
> That's strange.  stderr on my system is unbuffered, unless there's
> something wrong with this code:
> #include <stdio.h>
> int main()
> {
>    fprintf(stderr, "stderr is unbuffered");
>    sleep(60);
> }

Quite right.  Stderr is indeed unbuffered on my Linux system too,
as demonstrated by your program.  Stdout is line buffered.

This may vary on some older Unix systems, but I just tried it on
OS X and got the same result as on linux.


More information about the Courses mailing list