[rescue] Help with SunFire V240 Server
abuse at cabal.org.uk
Sun Apr 7 11:49:39 CDT 2013
On Sun, Apr 07, 2013 at 11:34:05AM -0400, Carl R. Friend wrote:
> On signed arithmetic for logical-block addressing -- WHY? The cynic in me
> leans towards laziness or lack of attention to detail. Surely a negative
> block would lead to either a seek-to-spindle event or an unload (depending on
> where cylinder 0 is). Why not use the whole width of the word to express an
> absolute offset and be done with? You get twice as many blocks by not wasting
> the sign bit.
It's not always obvious from API documentation whether a field is signed or
unsigned, and signed values will often get shoved into an int, whether by
accident, laziness, or a feature/bug in one's language. So it's defensive
design to treat unsigned values with a MSB of 1 as an error.
You'll see this pattern all over the place. For example, userspace pointers in
x86_64 operating systems are always positive when cast to int64_t. Java doesn't
allow unsigned integers at all to avoid just this problem.
More information about the rescue