3 ms·
You have to be careful drawing conclusions about output buffering when you're using this kind of stdout redirection tool. The stdio library changes its bufferin
by dn3500 4y ago
You have to be careful drawing conclusions about output buffering when you're using this kind of stdout redirection tool. The stdio library changes its buffering behavior depending on what stdout is connected to. For example, if stdout is a file, the stream is fully buffered, but if it's a tty, the stream is line buffered. I don't know what it does if stdout is a pipe.
- mananaysiempre 4y agoIf it’s a pipe, then it’s the same as for a regular file. POSIX says[1] “the standard input and standard output streams are fully buffered if and only if the stream can be determined not to refer to an interactive device”; the Glibc implementation[2] looks at isatty(). [1] https://man7.org/linux/man-pages/man3/stdin.3p.html https://man7.org/linux/man-pages/man3/stdin.3p.html [2] https://sourceware.org/git/?p=glibc.git;a=blob;f=libio/filedoalloc.c;hb=HEAD https://sourceware.org/git/?p=glibc.git;a=blob;f=libio/filed...