However, most applications will autoflush STDOUT when it's connected to a tty.GNU libc by default opens stdout in line buffered mode if it's tty, and stderr is opened in unbuffered mode. The following code will demonstrate behavior:
On my Ubuntu it outputs "This is stderror output" and 5 seconds later "This is stdio output"#include <stdio.h> #include <unistd.h> main() { printf("This is stdio output"); fprintf(stderr, "This is stderror output"); sleep(5); }
In reply to Re^2: can you autoflush a program in unix?
by zwon
in thread can you autoflush a program in unix?
by redss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |