home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!mcsun!sun4nl!fwi.uva.nl!casper
- From: casper@fwi.uva.nl (Casper H.S. Dik)
- Subject: Re: Sun's XDR routines won't work on Sun machines ...
- Message-ID: <1992Sep10.130205.9812@fwi.uva.nl>
- Sender: news@fwi.uva.nl
- Nntp-Posting-Host: adam.fwi.uva.nl
- Organization: FWI, University of Amsterdam
- References: <WRU6L3V@mailgzrz.tu-berlin.de>
- Date: Thu, 10 Sep 1992 13:02:05 GMT
- Lines: 23
-
- mauriti@cs.tu-berlin.de (Frank Hartlep) writes:
-
-
- >... although they do on a NeXT.
- >Perhaps somebody can see an error in this code.
-
- Funny, someone has exactly the same problems as you did, some days ago.
-
- > xdrmem_create (&Stream, Buffer + Offset, BufferSize - Offset, XDR_ENCODE);
-
- This call is in error: Offset is not guaranteed to be a multiple of
- 4 bytes in your code, but the documentation says it should be.
- Sun forgot to document that you should properly align the ``Buffer + Offset''
- parameter on a 4 byte boundary. The Bus error is an alignment error
- (Dbx will tell you as much). NeXTs don't require strict alignment,
- but the code will run slower. The culprit is xdrmem_*long where
- a char * is cast to a long *. For efficiency's sake, I expect that
- Sun will change the documentation, not the code.
-
- Casper
- --
- | Casper H.S. Dik
- | casper@fwi.uva.nl
-