The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux > Red Hat
.
google unix.com



Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unix to LINUX Kuz972 UNIX for Dummies Questions & Answers 0 09-22-2005 05:44 AM
Unix, Linux etc Kynaeus UNIX for Dummies Questions & Answers 2 10-04-2004 04:26 PM
What is unix and is linux a unix system Perderabo Answers to Frequently Asked Questions 0 03-13-2004 09:22 PM
which is better, Unix or Linux warmth High Level Programming 1 07-20-2001 11:48 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-18-2009
roosse77i roosse77i is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 4
'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.
  #2 (permalink)  
Old 09-18-2009
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,929
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.

Last edited by Corona688; 09-18-2009 at 05:30 PM..
  #3 (permalink)  
Old 09-21-2009
roosse77i roosse77i is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 4
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!
  #4 (permalink)  
Old 09-21-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,913
For your information, the standard convention is the big-endian on the network.
Reply

Bookmarks

Tags
int, linux, lsb, msb

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:43 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0