Support of files/raw partitions > 4Gb

Bill Davidsen davidsen at
Wed Feb 14 16:32:29 UTC 2007

Kirill Berezin wrote:
>> As a matter of good practice, all offsets should be type off_t, since 
>> they may not match any other type in size.
> This is a really good style, but in this case one should carefully 
> convert small types,  because the use of small types is essential to 
> save the storage space.

In general "small" or "large" are irrelevant, "correct" is. Using 
appropriate sizes avoids issues such as not supporting more than 4GB 
files. Given that many compilers use full size integers in structs by 
default, I'm not sure how much space small size typically save, and 
converting to and from small sizes like char and short to the CPU native 
integer size certainly uses some cycles. I have no argument with using 
the smallest size which will legitimately hold the full range of values, 
but I doubt it make a measurable saving relative to the disk and memory 
requirements of a typical news server.

I'm not saying your point is wrong, clearly no value should be larger 
than is needed, but I doubt that there's a big saving to had by doing 
that. I admit I believe in having programs pedantically correct, not 
everyone may agree.

bill davidsen <davidsen at>
  CTO TMR Associates, Inc
  Doing interesting things with small computers since 1979

More information about the inn-workers mailing list