~mirabilos/klibc/master

Viewing all changes in revision 2044.

  • Committer: H. Peter Anvin
  • Date: 2016-02-01 10:41:00 UTC
  • Revision ID: git-v1:cf9c7d2382eadc5699d3e4032b3e1774eccc36da
[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>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: