LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-05-2008, 10:06 AM   #1
emp1953
LQ Newbie
 
Registered: Nov 2007
Posts: 18

Rep: Reputation: 0
Endian issues in RedHat


I was just jolted into reality when I found that my linux application running on an intel chip became little endian. I am communicating with a Unix (big endian) platform. None of my communication/message constructs are now valid.
Are there any plug and run endian conversion tools (or code if I have to implement it) available that anyone knows of.

Thanks emp1953
 
Old 02-06-2008, 05:38 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,839

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
Consider yourself lucky you don't have EBCDIC <==> ASCII issues as well ...

If you are doing your own (raw) data transfers, I think you are going to have to handle it yourself. It's a bitch if you have a lot of embedded null values - guess how I know ...
 
Old 02-06-2008, 06:31 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Actually there are plenty of "swap bytes" C codes in the internet, that you can use as template. Take in mind that byte swapping works for pure binaries (I mean files containing only numbers). If there are character values, they must not be swapped.
 
Old 02-07-2008, 11:17 AM   #4
emp1953
LQ Newbie
 
Registered: Nov 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
Consider yourself lucky you don't have EBCDIC <==> ASCII issues as well ...

If you are doing your own (raw) data transfers, I think you are going to have to handle it yourself. It's a bitch if you have a lot of embedded null values - guess how I know ...
Yes I'm using a good CM product.
 
Old 02-07-2008, 08:24 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,169

Rep: Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205
Yes, it's "an illegitimate human being."

Byte-swapping functions do exist, however, and you'll have to use them. Note, however, that many libraries do byte-swapping for you or provide a global way to control that... possibly at compile-time when the library is built. Endian-issues are not that uncommon, after all.

EBCDIC? "Bah! These kids today... why, back in my day we had to do our homework in Baudot!"

{I've still got my "card saw," syg00... do you? And I'm definitely a member of the "I dropped an entire box" club.}
 
Old 02-07-2008, 09:43 PM   #6
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,191

Rep: Reputation: 105Reputation: 105
Quote:
Originally Posted by sundialsvcs View Post
{I've still got my "card saw," syg00... do you? And I'm definitely a member of the "I dropped an entire box" club.}
Hey, how many other digital media besides cards are still readable after that many years? Floppies, zips, even CDs turn up unusable. Remember how the guy in Cryptonomicon broke the code? He pulled out the box of cards from his dad's belongings after he died.

Last edited by choogendyk; 02-07-2008 at 09:49 PM.
 
Old 02-08-2008, 08:26 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,839

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
No, some of my old "junk" gets tossed out every time we move house .... :shrug:.

Where I have had issues was using C to drive a raw TCP transfer of RMF (performance) data - it's composed of variable numbers of self-defining (big endian EBCDIC) fields than are *full* of binary zero values. Gave up in disgust.
There is now a z/OS CIM Server (based on OpenPegasus), so I probably should revisit it one day.

Last edited by syg00; 02-08-2008 at 08:29 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
loading additional modules in endian 2.1 dbmacartney Linux - Software 0 04-03-2007 05:46 AM
Endian Firewall Upgrade sombra_tommy Linux - Software 1 03-15-2007 05:32 AM
problem in understanding little endian/big endian machine program indian Programming 6 04-19-2006 03:50 PM
big endian little endian? blackzone Linux - Hardware 4 09-23-2004 07:04 AM
What is all this big endian-little endian stuff about? vdemuth Linux - Newbie 1 04-28-2004 03:16 AM


All times are GMT -5. The time now is 10:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration