On Fri, 19 Nov 2021 21:31:12 -0600, Scott Cheloha wrote: > Is there a nicer way to pick a "reasonable" buffer size when we just > want to move as many bytes as possible on a given platform without > hogging the machine?
Not really. But I don't think you need to worry about "hogging the machine" with a 64K buffer. One advantage to using stdio is that it will use the optimal I/O blocksize automatically so you could try using that instead of write(2) and see how it performs. > I thought MAXBSIZE was that constant, because we use it elsewhere, > e.g. in cat(1) and wc(1), but if not then what is the right thing? > Is it BUFSIZ? BUFSIZ is only 1K on OpenBSD, which is its own problem. - todd
