[Gllug] endian.h

rich at annexia.org rich at annexia.org
Wed Feb 5 16:23:11 UTC 2003


> >Big Endian (aka network byte order)
> >Little Endian  (busted x86 byte order)
> >
> >So betoh32 <-> ntohl && letoh32 <-> htonl
> 
> Which will, of course, fail on Linux/SPARC, Linux/PPC and other big
> endian ports, where ntohl() and htonl() are NOPs. To paraphrase,
> "all the world's not an x86".

Hmmm ... except that it probably won't fail. On, say, Sparc machines,
the betoh32 (Big Endian to Host) transformation _is_ a null transformation,
because Sparcs are already Big Endian.

Rich.

-- 
Richard Jones, Red Hat Inc. (London, UK) http://www.redhat.com/software/ccm
http://www.annexia.org/ Freshmeat projects: http://freshmeat.net/users/rwmj

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list