Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Aug 2002 20:27:33 +0100
From:      Scott Mitchell <scott.mitchell@mail.com>
To:        "Balaji, Pavan" <pavan.balaji@intel.com>
Cc:        "'Matthew Seaman'" <m.seaman@infracaninophile.co.uk>, "'freebsd-questions@freebsd.org'" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: GCC versions!!!
Message-ID:  <20020805202733.B376@fishballoon.dyndns.org>
In-Reply-To: <3D386AED1B47D411A94300508B11F18704AD699A@fmsmsx116.fm.intel.com>; from pavan.balaji@intel.com on Mon, Aug 05, 2002 at 12:11:39PM -0700
References:  <3D386AED1B47D411A94300508B11F18704AD699A@fmsmsx116.fm.intel.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 05, 2002 at 12:11:39PM -0700, Balaji, Pavan wrote:
> 
> That was my guess. But, now how do I set it right, if I'm working on
> transferring data between two such machines?
> 
> 
> Pavan Balaji,
> Intel Corporation
> Email: pavan.balaji@intel.com

The usual solution is to make sure the bytes of your ints/longs/whatever
are written to the disk/network/whatever in a known order (usually
big-endian, but it doesn't matter, as long as you know what it is), and
rearranging them (if necessary) into the native byte order when you read
them back again.

man htonl for an overview of the library functions that do this for you.

HTH,

	Scott

-- 
===========================================================================
Scott Mitchell          | PGP Key ID | "Eagles may soar, but weasels
Cambridge, England      | 0x54B171B9 |  don't get sucked into jet engines"
scott.mitchell@mail.com | 0xAA775B8B |      -- Anon

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020805202733.B376>