[klibc] fwrite: flush before a large write to allow better bypass

If we are doing a large write, flush the buffer preemptively, so we
don't end up double-buffering a sequence of BUFSIZ writes simply
because we started out with something in the buffer.

This doesn't increase the number of system calls, since we will always
need to do two system calls in this case.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
1 file changed