Files with negative offsets
Posted Jun 2, 2005 7:09 UTC (Thu) by xoddam
Parent article: Files with negative offsets
A negative offset from the beginning of a file really is meaningless, and
a cleaner solution to this problem would be to make the offset type
unsigned so that addresses with the high bits set are simply high
positive integers. After all, very very very very large files might
conceivably have meaningful contents past offset 2^63 (not).
Unfortunately the semantics of the loff_t type require a signed integer
because it may also describe an offset from the current position in the
file, or from the end of the file.
Short of defining a new unsigned type for the current offset into a file,
Linus' solution is about as correct as can be in this situation.
to post comments)