Networker

Re: [Networker] Big endian versus little endian?

2003-12-11 19:05:41
Subject: Re: [Networker] Big endian versus little endian?
From: Darren Dunham <ddunham AT TAOS DOT COM>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Thu, 11 Dec 2003 16:05:43 -0800
> I haven't started yet, but I plan on moving my Solaris server to Linux.  I 
> got the same response about the endians.
>
> When I think about it, if that was a problem (or *the* problem when doing a 
> migration), wouldn't simple things like copying files or un-tar'ing files 
> between the two OS's not work?

It all depends on the application.

As long as the byte order is specified in the output format (be it on
tape or over the network), and the application can handle that, then
everything is fine.

It becomes a problem when you work with data that is larger than a byte
(word, long, complex data structures), and you use OS calls to save the
data to external storage (tape, network) in a manner that preserves the
OS byte ordering. (think write(fd, *buf, bufsize) where *buf points to a
data structure).

This is why the hton* and ntoh* functions are available so that
applications can use them to ensure a particular ordering.

So *some* applications can safely import/export between separate endian
architectures and others cannot.  It's not purely an OS issue.

--
Darren Dunham                                           ddunham AT taos DOT com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >

--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=