[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: linux 2.3/4 and large files



"Terry Katz" <katz@advanced.org> writes:

> I've been away from the list for a little while, and am not sure if this was
> brought up yet, if it was, I'm sorry ...
> 
> Playing around with the latest unstable branch of the linux kernel today, I
> noticed a 'bug' (not really) in the standard include files (namely
> bits/types.h) and linux 2.3/4 .. __off_t is defined as a 'long int'
> (signed), making the max value 2147483647.. after ungzip'ing a log file,
> totaling 8gig (uncompressed), the file size showed up as 630meg or so using
> ls and stat directly (performing a head and tail on the log file, and the
> same log file on an irix box, showed that the entire file was indeeed
> there)..  I know that even if off_t was unsigned, the max would only be
> 4294967295 bytes (4gig)....
> 
> Does anyone know if there are plans on fixing this? (i know this is not
> debian specific, just wondering if anyone knows...)

Its perfectly right. Its an offset, so it can be negative. For example 
you can seek to position -10 relative to the current position.

The code should be changed to use llseek on 32 Bit linux systems (if
llseek is present), which uses two 32 Bit values to specify the offset 
and also reports back the size as a struct with 2 longs.

May the Source be with you.
			Goswin


Reply to: