- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: How to know 64 bit or 32 bit
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2007 08:31 PM
07-29-2007 08:31 PM
Can i know how to find out a HP-UX machine is 32 bit or a 64 bit machine. Is there any command for that.
Even if it is not a HP machine can i write a code snippet to find out whether i am using 32 bit machine or a 64 bit machine.
thanks in advance
Vikram
Solved! Go to Solution.
- Tags:
- file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2007 08:35 PM
- Tags:
- getconf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2007 08:35 PM
07-29-2007 08:35 PM
Re: How to know 64 bit or 32 bit
You can use
getconf KERNEL_BITS
it will give you the O/P which you need.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2007 11:18 PM
07-29-2007 11:18 PM
Re: How to know 64 bit or 32 bit
# getconf KERNEL_BITS
...will tell you the "bitness" of your current kernel, e.g. "64"
# getconf HW_CPU_SUPP_BITS
...will tell you the "bitness" your hardware will support, e.g. "32/64"
# file filename
...will return:
"ELF-64 executable object file - PA-RISC 2.0 (LP64)" for a 64bit codefile, otherwise something like:
"PA-RISC1.1 shared executable" for a 32bit one.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2007 12:42 AM
07-30-2007 12:42 AM
Re: How to know 64 bit or 32 bit
---
Even if it is not a HP machine can i write a code snippet to find out whether i am using 32 bit machine or a 64 bit machine.
---
You mean if is not hpux.
Linux
# getconf LONG_BIT
32
AIX
# bootinfo -K
64
Solaris
# isainfo -kv
64-bit sparcv9 kernel modules
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2007 01:14 AM
07-30-2007 01:14 AM
Re: How to know 64 bit or 32 bit
Thank you very much for the reply.
This definitely solved my problem. But one thing i want to ask here for curiosity.
Can i write a code in C to tell this
for ex- to know a machine is little endian or big endian i can write like this.
union {
int Var;
char One;
}endian;
main ()
{
endian end;
end.Var = 0x01;
printf("%c",end.One);
}
thanks and regards
Vikram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2007 03:50 PM - edited 09-25-2011 12:51 PM
07-30-2007 03:50 PM - edited 09-25-2011 12:51 PM
Re: How to know 64 bit or 32 bit
>Can I write a code in C to tell this
You can only write a program to tell what size the current program is, not the kernel.
For HP-UX, you could test a define:
#ifdef __LP64__
Or for general LP64 machines:
#include <stdio.h>
int main() {
printf("size of void*: %d\n", (int)sizeof(void*));
return 0;
}