Re: how to detect a 32 bit process on 64 bit kernel

From: Bodo Eggert
Date: Thu Dec 16 2004 - 08:10:03 EST


Michael S. Tsirkin wrote:
> Quoting r. Brian Gerst (bgerst@xxxxxxxxxxxxx) "Re: how to detect a 32 bit

>> The most portable way to do this is to have the first member of the
>> structure be a 32-bit value containing the size of the structure.

Better: Use version numbers.

> The size wont be sufficient here since its variable size
> (ends with an array).

Use the size without the array, check the array size seperately.
Or see above.

> Sure, I could also just ask everyone to pass pointers in a
> packed long long, but either way it will break the applications.

If the size of structs you use in APIs is system dependant, it's most
likely b0rken.

> Why wouldnt it make sence for struct task to have a bit that tells
> me its a compat system?

Not having it will prevent you from creating strange interfaces.-)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/