Using setvbuf(), we can change the buffer type of a FILE* stream to one of:
_IONBF(unbuffered)_IOLBF(line buffered)_IOFBF(fully buffered)
For example, in order to set stderr to line buffered, we could do the following:
setvbuf(stderr, NULL, _IOLBF, 0);
Is there also a way to figure out the current buffer type for a given output stream (using a file descriptor or FILE pointer)?