Re: return values - 32, 64, 128 bits, type defs...etc/platform size

From: Peter Rival (frival@zk3.dec.com)
Date: Fri Apr 21 2000 - 17:38:33 EST


Linda Walsh wrote:

> Earlier I wrote:
> > A point I forgot to ask about...Um. It wouldn't appear that any kernel calls return more than
> > 32 bits. I haven't thoroughly examined the code yet, but is it possible and/or feasible for a kernel
> > call to return a 'unsigned long long' as a return value? Else we'd have to pass in a pointer.
> ---
> Fraddle. Excuse me while I keep "thinking out loud"...so my only hope
> was to look at how llseek returned a 64 bit value. It drops the ball. If
> the point to seek to takes >32 bits, it just returns an error (EOVERFLOW) (implies:
> "go ye therefore and do likewise").
>
> Code says this should only happen on a 32bit platform. That would
> seem to imply that size of 'long long' = 'long' = 'int' on all 64 bit platforms.
> Is that the case?

Nope. And a classic mistake of 32bit programmers at that. ;) On Alpha (dunno about SPARC) long long ==
long == 64 bits, int == 32 bits.

> What does a 64 bit platform use to represent 128-bit
> values (assuming a 'long-native int' exists)? long long long int? Eep.
>

Uh, there is no native 128-bit data type. Not for anything I know of, anyway. (Probably someone has
hacked together the appropriate size struct and knows they can get away with pushing the bits around,
but...yick...)

 - Pete

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:19 EST