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



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.

Have a look at configure (autoconf/automake): a small code snippet is
echo'd to a file and compiled and the output parsed ;-) You can do all
you want in a bash-Script...

Or try the "file" command: file xxx.bin will even tell you, whether the
executable is dynamically linked ;-)

How much time do you want to spend ;-)

Good luck...
.



Relevant Pages