Re: read() MAX_IO_SIZE bytes, more than SSIZE_MAX?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Randall S. Becker <rsbecker <at> nexbridge.com> writes:

> 
> On 2015-02-07 13:07PM Randall S. Becker wrote:
> >On 2015-02-07 12:30PM Torsten Bögershausen wrote:
> >>On 2015-02-07 17.45, Joachim Schmitz wrote:
<spip> 
> Although I do agree with Jojo, that MAX_IO_SIZE seems to be a platform
> constant and should be defined in terms of SSIZE_MAX. So something like:
> 
> #ifndef MAX_IO_SIZE
> # ifdef SSIZE_MAX
> #  define MAX_IO_SIZE (SSIZE_MAX)
> # else
> #  define MAX_IO_SIZE (8*1024*1024)
> # endif
> #endif
> 
> would be desirable.

It would be way too large on some platforms. those 8MB had been chosen for 
a good reason, I assume:

/*
 * Limit size of IO chunks, because huge chunks only cause pain.  OS X
 * 64-bit is buggy, returning EINVAL if len >= INT_MAX; and even in
 * the absence of bugs, large chunks can result in bad latencies when
 * you decide to kill the process.
 */

However it should never be larger than SSIZE_MAX

��.n��������+%������w��{.n��������n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]