determine computer type (big or little indian)

determine computer type (big or little indian)

Post by Sebastien Pamar » Mon, 10 Apr 2000 04:00:00



Hello,

Is there a unix system function to determine the computer memory
ogranization ?

Thanks,

Sebastien Pamart

 
 
 

determine computer type (big or little indian)

Post by Juergen Hein » Mon, 10 Apr 2000 04:00:00



>Hello,

>Is there a unix system function to determine the computer memory
>ogranization ?

[...]
No, although an easy way might be ...
/*
** network byte order is big endian
*/
if( htonl( 0x1234ul ) == 0x1234ul ) {
    big_endian();
Quote:} else {

    little_or_pdp11_endian();
Quote:}

... aside from other solutions.

Cheers,
Juergen

--
\ Real name     : Jrgen Heinzl                 \       no flames      /


 
 
 

1. Little Indian/Big Indian

Hi,

I have a file on Linux(little Indian m/c) and written
some long integer data in file. Now I get this file on solaris
(Big indian ) m/c (via binary ftp).
How can I get same data which I have entered on linux on
solaris m/c?

Basically I want how to convert little indian m/c file
to big indian m/c file and vice a versa.

Thanks,
Sandeep

2. Intergraph video drivers???? Help!

3. big indian-little indian

4. break key in xterm

5. problem of little indian to big indian code

6. sis 6215c

7. Big/Little Indian

8. x and monitor power management

9. Big Endian/Little Indian ?

10. Little/big-endian confusion

11. BIG ENDIAN ---> LITTLE ENDIAN

12. keeping a cynical gaze and a jaundiced eye on Big Brother's Little Helpers

13. Solaris <-> Linux, Big Endian vs. Little Endian