Thread (16 messages) flat view 16 messages, 5 authors, 2016-06-15

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

From: Torsten Bögershausen <hidden>
Date: 2016-06-15 23:03:45

On 2015-02-07 18.29, Joachim Schmitz wrote:
Torsten Bögershausen <tboegi <at> web.de> writes:
quoted
On 2015-02-07 17.45, Joachim Schmitz wrote:
<snip>
quoted
How about changing wrapper.c like this:

#ifndef MAX_IO_SIZE
 #define MAX_IO_SIZE (8*1024*1024)
#endif
---------------------
and to change config.mak.uname like this:

ifeq ($(uname_S),NONSTOP_KERNEL)

	BASIC_CFLAGS += -DMAX_IO_SIZE=(32*1024)
Does this work for you ?
Of course it would, but, 
a) 32k is smaller than we can go (and yes, we could make it 52k)
Sorry, I missed that:  (52*1024)
b) never ever should read() be asked to read more than SSIZE_MAX, this  
should be true for every platform on the planet? You may want to have is 
smaller than SSIZE_MAX (like the current 8MB vs. the possible 2TB on 
Linux), but surely never larger?
Good question.
I don't know every platform of the planet well enough to be helpful here,
especially the ones which don't follow all the specifications.

In other words: As long as we can not guarantee that SSIZE_MAX is defined,
(and is defined to somethong useful for xread()/xwrite() )
we should be more defensive here:

tweak only on platform where we know it is needed and we know that it works.

And leave the other ones alone, until someone finds another
platform which needs the same or another tweak and sends a tested patch.


Thanks for the report, do you want to send a patch to the list ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help