in reply to Re^2: Portability of Large read Lengths
in thread Portability of Large read Lengths
SSIZE_MAX is defined as the maximum value for the data type ssize_t. So 32k-1 is the smallest it will ever be (since ssize_t is guaranteed to be at least 16 bits).
My experience is that using a read buffer of less than 4kB is rarely a good idea. 16kB would make a good default and present no portability problems. Allowing users to specify a much larger read length would also be wise.
A read length of 512 on most systems means that you are reading in less than one "block" of data and so special buffering needs to be done which slows down I/O.
- tye
|
|---|