Re: Kernel bits

Keith Owens
2000-11-27T14:01:51Z

On Mon, 27 Nov 2000 07:36:22 -0600 (CST),
Chad Schwartz <cwslist@main.cornernet.com> wrote:
>int main(void) {
> printf("Size of an unsigned long is %d bytes\n",sizeof(unsigned long));
> return(0);
>}
>
>That simple program will tell you that an unsigned long is 4 bytes, or 8
>bytes.
>
>It is then a safe assumption - that if you get back '8', that you're
>running a 64bit kernel, on a 64bit processor.

No, that only tells you the size of a long under the compiler you used.
If you are on an Intel IA64 (64 bit kernel) but you compile with gcc
for ix86 (32 bit userspace) then sizeof(long) is 4. IA64 runs both
native and ix86 code, sizeof(any userspace field) tells you nothing
about the kernel.