Buffering Many problems you find are related to buffering issues A file can be _IONBF, _IOLBF, _IOFBF With setvbuf(3) you can change the set up stdout is usually _IOLBF stderr is usually _IONBF if you open files with fopen(3), you get _IOFBF We must also remember that a tty is special The tty is managed by a line discipline Normally, it has a line buffer too tcgetattr(3) and tcsetattr(3) work on tty settings