On 05/17/2012 05:07 PM, Linus Torvalds wrote:On Thu, May 17, 2012 at 4:51 PM, H. Peter Anvin<hpa@xxxxxxxxx> wrote:
The sane thing would seem to be to change __BITS_PER_LONG to 32 on x32
and fix the padding hacks in struct shmid64_ds; H.J., would you agree?
Ugh. That looks like a disaster.
The padding hacks that depend on __BITS_PER_LONG seem pretty damn broken anyway.
They only work if the kernel agrees with the value (which is against
the whole point of making __BITS_PER_LONG be about some user-level ABI
thing) or for little-endian machines.
IOW, all the __BITS_PER_LONG games look totally broken to me. I can't
see how they could possibly even be fixed.
Well, on existing compat (e.g. i386) __BITS_PER_LONG is definitely not
the same as kernel. And yes, I don't see how the heck this was ever
correct on bigendian machines or even for compat in any form (if the
kernel tries to interpret the extra bits and user space didn't
initialize them we're lost.)
The "logical" thing to do here seems to just use __s64, but I have no
idea if that would suddenly break bigendian architectures...
David, Ralf, do you have any idea what e.g. MIPS does here?