'int' Unix to Linux!! Help!!

Hi!
I'm having some troubles to make a Unix system communicate with a Linux system, because the LSB and MSB of an 'int' is inverted in each other.
I can't use a Algorithm for Bit Reversal, because I would have to change a lot of the services that I use im my application.
Is there any way to change the LSB and MSB of the 'int' inside of Linux?

Sorry for my english mistakes, and sorry for may newbie explication. This is the first time that I'm using Linux this way.

You mean you can't change the code, and want the system to somehow understand the layout of your packets and adjust it for you? That's not too likely since the system doesn't understand what layout of data you have, only your application.. you wouldn't want it to swap bytes in strings, for instance. If you can modify the code, see 'man htonl'. It would be safe to use it on both systems since it only reverses on systems where appropriate to do so.

A few processors like the G series can partially change whether they're LSB or MSB, but the emulation is imperfect and system-wide, you'd need a whole new operating system. (and of course a G3/4/5/POWER computer.)

This isn't a UNIX vs Linux thing, by the way. Linux can be found on MSB and LSB systems alike, it's the architecture its running under that's MSB or LSB.

Okie, Corona688!
Thanks for your help. I think I'll have to change some of my app code, anyway. It will be veeeery boring, but I guess this is the only way.

Thanks!:slight_smile:

For your information, the standard convention is the big-endian on the network.