Operating System - HP-UX
1830933 Members
1928 Online
110017 Solutions
New Discussion

OS is running in 32 bit or 64 bit mode ?

 
SOLVED
Go to solution
pramodsharma
Advisor

OS is running in 32 bit or 64 bit mode ?

Hi ,
Can anyone tell me how to determine whether OS is running in 32 bit or 64 bit mode programtically (in c ) ?
Can sysconf system call can tell this ?

Regards,
Pramod
5 REPLIES 5

Re: OS is running in 32 bit or 64 bit mode ?

Hi,

# getconf KERNEL_BITS
64


HTH

Duncan

I am an HPE Employee
Accept or Kudo
Oviwan
Honored Contributor
Solution

Re: OS is running in 32 bit or 64 bit mode ?

Hey

man sysconf


KERNEL_BITS
_SC_KERNEL_BITS

Returns the number of
bits used by the kernel
for pointer and long
data types. Current
values include 32 and
64.


Regards
pramodsharma
Advisor

Re: OS is running in 32 bit or 64 bit mode ?

Thanks a lot . I hope similar functionility of sysconf is across all the non-windows platforms like solaris /linux etc.

Regards,
Pramod
Dennis Handly
Acclaimed Contributor

Re: OS is running in 32 bit or 64 bit mode ?

>I hope similar functionality of sysconf is across platforms like solaris /linux etc.

Well, if it supports POSIX, it has to be there. Look at sysconf(2) and at the bottom it says:
STANDARDS CONFORMANCE and "sysconf() was developed by HP and POSIX"

getconf(1) is also part of POSIX.
ln_unix
Frequent Advisor

Re: OS is running in 32 bit or 64 bit mode ?

If you dont wanna do this by programtically , then go simply on this location in hp-ux by doing :-

$ cd /var/opt/ignite/local/manifest

and then there is file manifest.info

$ cat manifest.info | more

this'll show you the bits (32 or 64).

Regards,

Lokesh Nagpal.