read() wont allow me to read files larger than 2 gig (on a 64bit)

Bastian Blank waldi at debian.org
Fri Dec 25 14:02:03 UTC 2009


On Fri, Dec 25, 2009 at 09:29:35AM +0100, glide creme wrote:
> I can't read files larger than 2 gig on my ubuntu64bit using 'read()',
> the problem is not related to the allocation itself, which works.
> Attached is a sample program that illustrates this.

This is a misinterpretation of the spec by you.  Please reread the
manpage of read(2)[1].  The second parameter of read defines the maximum
amount that it may read.  It is no bug if the actual read returned less
than this amount.

Bastian

[1]: man 2 read
-- 
Suffocating together ... would create heroic camaraderie.
		-- Khan Noonian Singh, "Space Seed", stardate 3142.8




More information about the kernel-team mailing list