The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Byte Padding naan High Level Programming 6 02-22-2007 02:09 AM
AWK and padding values kshelluser UNIX for Dummies Questions & Answers 3 11-29-2006 02:14 PM
Padding variables flounder High Level Programming 1 09-05-2006 09:11 AM
Padding vijaygopalsk UNIX for Dummies Questions & Answers 2 06-27-2003 07:51 AM
Zero Padding to a string Wing m. Cheng High Level Programming 3 09-16-2002 06:58 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-28-2002
Registered User
 

Join Date: Feb 2002
Posts: 14
Padding issues

Hello,
Structure padding & structure size are different on Compaq & HP UNIX. When structures are transfered via netfork from Compaq to HP will this be a problem? If yes, what can be the solution?
Thanks,
shilpa
Forum Sponsor
  #2  
Old 03-01-2002
killerserv's Avatar
Unix Predator
 

Join Date: Dec 2000
Location: Phoenix, AZ
Posts: 670
Shilpa,
What do you mean transfer structure. are you saying transfering the data structure or filesystem (kernel structure) please define your question.
  #3  
Old 03-01-2002
Registered User
 

Join Date: Feb 2002
Location: Brabant, Belgium
Posts: 65
If you are talking about stuff like this:

struct foo
{
int bar;
char c;
DEFIT honk;
long snafu;
};

...
struct foo *pfoo = malloc( ...);
...

send_from_1_2_other(pfoo, ....);
...

This is a bad idea.
It will only work inside an absolutely heterogenous, eh, structure.
You would want to either have a conversion routine in each end, like ntohfoo(), htonfoo() modelled after the int and long ones, or, depending on the contents, you might want to transfer in ASCII, taking performance issues into account.

Atle
__________________
PS
All of the above is to be read as '... unless I am wrong'
ENDPS
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:34 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0