Is it possible to force glibc to use the same buffer for stdout and stderr?
If I tee the both outputs:
./tests/tests 2>&1 | tee log
I get mixed messages (i.e. messages are ordered inside stdout and stderr but not with respect to each other). I can turn off the buffering:
stdbuf -i0 -o0 -e0 ./tests/tests 2>&1 | tee log
But it cause large slowdown (I'm pushing hundreds of MB of log). Is it possible to do have buffering but have it shared between stdout and stderr? FD 1 and 2 points to the same output (as in example).