John Goerzen <[EMAIL PROTECTED]> writes:

> I wonder what the behavior of fwrite() in this situation is.  I don't
> know if it ever performs buffering such that write() is never called
> during a call to fwrite().

On Linux it duplicates unflushed output (hmm, I thought they fixed
this a few years ago). X/Open specification doesn't say anything
about this.

#include <stdio.h>
#include <unistd.h>
int main() {
   printf("1 ");
   fflush(stdout);
   printf("2 ");
   fork();
   printf("3\n");
}

Output:
1 2 3
2 3

In C you cay say fflush(NULL) to flush all open output streams.

-- 
   __("<         Marcin Kowalczyk
   \__/       [EMAIL PROTECTED]
    ^^     http://qrnik.knm.org.pl/~qrczak/
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to