Re: How to determine if running on a 32 or 64 bits kernel ?



laurent.charmet@xxxxxxxxx wrote:

And for the last time, uname is NOT the solution:
uname -m on a Linux on powerpc give me PPC64. It's a 64 bits OS/
kernel ? NO ! it's a 32 bits because all system binaries are 32 bits
ELF

Perhaps on that particular machine userspace is all 32-bit. It's possible to run 64-bit userspace as well.

It's incredible that it's impossible to determine if os/kernel is 32
or 64 bits (or 128 !) with a small call.

Userspace is easy...it's whatever you compiled for. On the kernel side of things uname generally gives the information, but not always.

From another point of view...if userspace can't tell the bit-size of the kernel, can it possibly matter for userspace?

Chris
.



Relevant Pages

  • Re: How to determine if running on a 32 or 64 bits kernel ?
    ... Userspace is easy...it's whatever you compiled for. ... On the kernel side ... of things uname generally gives the information, ... Have a look at configure (autoconf/automake): ...
    (comp.os.linux.development.system)
  • Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series..
    ... wrapper around the kernel build system, ... possible way to fix this would be fixing the data passed to userspace ... from uname. ... the build machine architecture is not necessarily the same as the ...
    (Linux-Kernel)
  • Re: [PATCH] ppc64: Fix PER_LINUX32 behaviour
    ... actually compile up ppc64 kernels from time to time... ... If uname wants to make it clear that uname has ... > own without asking the kernel what the kernel is. ... system calls were ignoring the personality and just returning what was ...
    (Linux-Kernel)
  • Which is simpler? (Was Re: [Suspend2-devel] Re: [ 00/10] [Suspend2] Modules support.)
    ... Complexity in kernel: doubleplusungood. ... Seriously, though, thanks for the opportunity to explain how Suspend2 works ... up with if you continue down the userspace track and seek to match ...
    (Linux-Kernel)
  • [patch 00/10] PI-futex: -V1
    ... We are pleased to announce "lightweight userspace priority inheritance" ... No registration, no extra kernel ... only a single owner may own a lock (i.e. no ... Priority Inheritance - why, oh why??? ...
    (Linux-Kernel)