__sfvwrite: allow writing buffers larger than BUFSIZ or st_blksize.
authormillert <millert@openbsd.org>
Sun, 28 Apr 2024 14:28:02 +0000 (14:28 +0000)
committermillert <millert@openbsd.org>
Sun, 28 Apr 2024 14:28:02 +0000 (14:28 +0000)
commit327caad7a1aa5b506b20fd6a1d086be2bb031eea
tree1094977f5211a47c57ca1b0f0346ed3227a6a22f
parent1da02efa02f01c0373cf40e84c0108140336ed3a
__sfvwrite: allow writing buffers larger than BUFSIZ or st_blksize.

This can vastly improve write performance.  For unbuffered writes,
we now write up to INT_MAX instead of BUFSIZE.  For buffered writes,
write the largest multiple of the buffer size (which may be st_blksize).
From Apple via enh at google.  OK tb@
lib/libc/stdio/fvwrite.c