Little Endiean and Big Endian


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Little Endiean and Big Endian
# 1  
Old 03-31-2006
Little Endiean and Big Endian

Dear Friends,

I have one question in my mind. That question is

"how to detect whether the system is little endiean or big endian"

Processing the bit position is the difference between this endians.
But I could not understand how to find the pariticular sytem works acccording to this pattern.

Advance Thanks for u All u r Answers. Smilie)

Thanks and Regards,
Nirmal Babu
# 2  
Old 03-31-2006
hi Nirmal,
There is one program in book titled network programming in unix by
Richard Stevens. See if you can that book. I had used the program form that book.
# 3  
Old 03-31-2006
I think you can easily check it using a C code where you create a union made of an integer and a char array that matches the integer size (4 bytes in x86, for example).

Then you assign the number 1 to the union's integer.
Checking the value of the first element of the array, and looking wether it's zero or one, you can determine system's endianess (i think it will be 1 in little endian).

Hope this helps

Salut
# 4  
Old 04-07-2006
Dear Reddymails and shesatmine,


Thank U Reddymails for the suggestion of the Unix book. It was very helpful to me. Thanks a lot.

Thank U shesatmine, i have tried. i was able to get get the solution.

Thanks and Regards,
Nirmal Babu
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Endian vs pfsense??

Hi Endian firewall free version if we do compare pfsense For a LAN network with active user 1000 Which do you recommend Share (0 Replies)
Discussion started by: mnnn
0 Replies

2. UNIX for Dummies Questions & Answers

How big is too big a config.log file?

I have a 5000 line config.log file with several "maybe" errors. Any reccomendations on finding solvable problems? (2 Replies)
Discussion started by: NeedLotsofHelp
2 Replies

3. Solaris

question about the little-endian in sparc

hi folks, in the sparc v9 manul , it says it is possible to access the memory data in little-endian mode, but there is only privilaged instruction that could set the PSTATE ( the cle bit ) regist. if I'm in the user mode , is it possible for me to access the data in little-endian mode? (10 Replies)
Discussion started by: zerocool_08
10 Replies

4. UNIX and Linux Applications

Migrating Oracle from Big Endian to Little Endian Platorm

Hi, We are trying to migrate an oracle database from Sun Solaris (SunOS 5.9 Generic_118558-28 sun4u sparc SUNW,Ultra-60) to Linux 2.6.18-53.1.19.el5 #1 SMP Tue Apr 22 03:01:10 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux which is basically a Big Endian to Little Endian conversion. We shutdown... (3 Replies)
Discussion started by: luft
3 Replies

5. UNIX for Advanced & Expert Users

Endian Conversion

Hi everybody, I met this week a problem. For now, we used TRU64 system based on alpha. Now, we're installing UP-UX systems (on Itanium). And we have problem with our files. Indeed, we use file with COMP-3, COMP-5 data. These files are used on both platforms. (we use also TXT files which... (1 Reply)
Discussion started by: bigmike59270
1 Replies

6. Programming

Big and Little Endian

We are developing an application using TLI for network communication.The Server Code is developed in Sun and client in SCO unix. When we route data from Client to Server we encrypt the data using DES algotithm utility.The problem we are facing that Sun uses Big Endian methodology to store data in... (1 Reply)
Discussion started by: S.P.Prasad
1 Replies

7. UNIX for Dummies Questions & Answers

How to view a big file(143M big)

1 . Thanks everyone who read the post first. 2 . I have a log file which size is 143M , I can not use vi open it .I can not use xedit open it too. How to view it ? If I want to view 200-300 ,how can I implement it 3 . Thanks (3 Replies)
Discussion started by: chenhao_no1
3 Replies

8. UNIX for Advanced & Expert Users

AIX endian again

Hi all I know AIX is big-endian machine.But does it read bytes in normal way from LSB. Does it happen in some machine that at multi-byte integer level it is Little-endian and while reading a single byte it is Big-Endian. This is urgent Thanks in advance. (3 Replies)
Discussion started by: Shobhit
3 Replies
Login or Register to Ask a Question