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



I probably not well exposed my need, but I have a small soft who run
on many machine/os (aix, hpux, irix, linux, bsd/mac, tru64,
win32, ...). And it display system info (memory, swap, cpu name, cpu
freq, number of cpu, os name), compilation option, ILP.

example:

E:\FF\Bin>tina_bench -bench info
-------------- Host name: grossebaf -----------
Version: 4.2.0 SP0 patch 2998 Build 7 (Feb 15 2008)
OS name=Windows Server 2003, OS release=Service Pack 2, OS
version=5.2.3790, Architecture name=Intel
2 X Intel(R) Pentium(R) 4 CPU 2.80GHz @ 2793 Mhz
Mem: 1024 MB, Swap: 1450 MB
Kernel=32 bits, Software=32 bits, Endian=little-endian, Data
Model=ILP32

Sorry if it's cut&paste from my wintel office PC lol !


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

It's incredible that it's impossible to determine if os/kernel is 32
or 64 bits (or 128 !) with a small call.
Thx for all who have try to help me.

Regards
.



Relevant Pages

  • Re: Identification 32/64 bit Linux
    ... (i.e., 64 bit cpu, but maybe Linux version was installed for 32 bit)? ... Not really a wanna-be, ...
    (comp.os.linux.setup)
  • Re: [PATCH 6/6] sched: disabled rt-bandwidth by default
    ... An application which hogs the CPU for 9.9 ... whether POSIX allows to do that or Linux obeyed the ... Your precious customer use case is simply crap. ... break kernel userspace API regardless of closed source or open source. ...
    (Linux-Kernel)
  • Re: [PATCH 6/6] sched: disabled rt-bandwidth by default
    ... An application which hogs the CPU for 9.9 ... whether POSIX allows to do that or Linux obeyed the ... I appreciate the nitpicking janitor of the most important POSIX ... Simply because we use common sense instead of following every single ...
    (Linux-Kernel)
  • Re: Die ideale Linux-Hardware?
    ... > Wird das Cool'n'Quiet-Feature der CPU bei der Installation von Linux ... > Netzteil mit 12cm-Lüfter nehme. ... Temperaturen zulassen. ...
    (de.comp.os.unix.linux.hardware)
  • Re: Linux on all new iron
    ... -- Any troubles with Linux on this mobo? ... Since you want to buy only one video card, ... -- Who's quiet CPU cooler is recommended? ... would go with 7200rpm drives, especially if you care for noise. ...
    (comp.os.linux.hardware)