This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: read() cant read files larger than 2.1 gig on a 64 bit system
I'm aware that the returnvalue from the 'read' function can be smaller
than the number of bytes expected.
But I think it should be clarified in the documentation, that the
function can't return a value larger than 2147479552.
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.
But I don't even know if this is a libc issue, I couldn't find the
implementation of these primitive posix io calls.
But more a kernel issue
http://www.gelato.unsw.edu.au/lxr/source/fs/read_write.c#L208
thanks
On Sat, Dec 26, 2009 at 5:58 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Friday 25 December 2009 17:34:18 glide creme wrote:
>> ?bytes_read = read(fd, data, bytes_expected);
>>
>> ?if (bytes_read != bytes_expected)
>> ? err(EX_DATAERR, "Read only %lu of %lu bytes",bytes_read, bytes_expected);
>
> a short read is not an error. ?please read the documentation.
> -mike
>