|
|
|
|
|
by dataflow
1561 days ago
|
|
That would be at best a Linux extension, not some general C behavior you can assume when writing your program. That said though, I can't even reproduce what you're saying on Linux: printf '%s\n' '#include <stdio.h>' 'int main() { setvbuf(stdout, NULL, _IONBF, 0); int r = fputs("Starting\n", stdout); fflush(stdout); fprintf(stderr, "%d\n", r); }' | cc -x c - && ./a.out >&-
// Prints '0' instead of dying
|
|