This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Network programming for eCos under linux


Andrew Lunn writes:

>> This shouldn't pose a problem since I've configured my ARM as
>> little-endian.  However, htons (), htonl (), etc should solve that
>> problem anyhow, shouldn't it?  I mean as far networking code goes that
>> is.  I would obviously have to be careful about data types between the
>> two if they were different.  It's nice to have the ARM with 32-bit
>> little-endian!  Makes my life a lot easier since I'm sending data to a
>> PC.
> 
> The problem is, if your machines both use the same endianness, you
> never know when you have missed out a htons(). If they are different
> endianness, it breaks. That why i like to write network code on a
> mixed Solaris & linux network, just to make sure. 
>

Pedant mode on... 

Stricly speaking, it doesn't matter whether you're running Solaris or
Linux.  Both are BE on SPARC and LE on IA32.  What you want is a mixed
SPARC & IA32 setup.  That said, if you pick a Linux machine at random 
there's probably a 99+ percent chance it's IA32 -- and if you pick a Solaris 
machine at random there's a 99+ percent chance it's SPARC. 

-- 
Grant Edwards
grante@visi.com 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]