Operating System - HP-UX
1819739 Members
2779 Online
109606 Solutions
New Discussion юеВ

how to find Endianness on HP

 
madhavabk
Regular Advisor

how to find Endianness on HP

Hi all,

Is there any command for finding Endianness on HPUX operating systems.

Thanks,
Madhava
3 REPLIES 3
Torsten.
Acclaimed Contributor

Re: how to find Endianness on HP

Hi Madhava,

I found this (C code):

===============================
#include
int endian;

TEST_ENDIAN(endian);

if (endian == 0)
printf("This a little endian system\n");

if (endian == 1)
printf("This a big endian system\n");
===============================

here:

http://docs.hp.com/en/B9106-90012/portal.5.html

HTH!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Alex Lavrov.
Honored Contributor

Re: how to find Endianness on HP

HP-UX and Solaris are big endian operating systems.

Linux and Windows are little endian.

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Muthukumar_5
Honored Contributor

Re: how to find Endianness on HP

It is big-endian. However you can change it to little endian.

Newer PA-RISC computers can be either big endian or little endian machines, however the HP-UX operating system is a big endian operating system.

Refer: http://docs.hp.com/en/5990-8172/ch02s10.html The Endian Difference Problem part

You can find endian type with gdb as,

# gdb -q
gdb)show endian
gdb)q
#

hth.
Easy to suggest when don't know about the problem!