This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: read() cant read files larger than 2.1 gig on a 64 bit system


* Mike Frysinger:

> On Saturday 26 December 2009 17:07:35 glide creme wrote:
>> Instead of the strange "  If  count is greater than SSIZE_MAX, the
>> result is unspecified.", which implies that a value smaller than
>> SSIZE_MAX is supported.
>
> seems pretty clear to me.  dont do it.

It's not that clear because SSIZE_MAX is defined as LONG_MAX, so the
rule doesn't kick in here.  (The reason for this rule is that
(ssize_t)-1 could be ambiguous).

It seems to me that libc is non-compliant here, but so are many other
systems.  You really need to loop around calls to read.  Even on
compliant systems, not doing that may lead to bugs when your program
is suspended with ^Z, and perhaps other fun.  So it's not worth fixing
libc, IMHO.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]