lkml.org 
[lkml]   [2004]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: how to detect a 32 bit process on 64 bit kernel
Date
Michael S. Tsirkin wrote:
> Quoting r. Brian Gerst (bgerst@didntduck.org) "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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.025 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site