home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / programm / 4610 < prev    next >
Encoding:
Text File  |  1992-09-10  |  1.3 KB  |  36 lines

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