home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6049 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  2.0 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!Sirius.dfn.de!zrz.tu-berlin.de!opal.cs.tu-berlin.de!mauriti
  2. From: mauriti@cs.tu-berlin.de (Frank Hartlep)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Sun's XDR routines won't work on Sun machines ...
  5. Message-ID: <IOT6Y7F@mailgzrz.tu-berlin.de>
  6. Date: 8 Sep 92 14:04:52 GMT
  7. Sender: news@mailgzrz.tu-berlin.de (News Manager)
  8. Organization: Technical University of Berlin, Germany
  9. Lines: 48
  10. Nntp-Posting-Host: hivehom.cs.tu-berlin.de
  11.  
  12.  
  13. Excuses if this message appears repeatedly, my newsreader isn't
  14. getting my first two tries.
  15.  
  16. ... although they do on a NeXT.
  17. Perhaps somebody can see an error in this code.
  18.  
  19.                 .
  20.                 .
  21.                 .
  22.  
  23.         BufferSize += 50000;
  24.         Buffer = malloc (BufferSize);
  25.         Offset = strlen (ARCHIVED) + strlen (Description) + 1 + 4;
  26.         sprintf (Buffer, ARCHIVED "%s", Description);
  27.         xdrmem_create (&Stream, Buffer + Offset, BufferSize - Offset, XDR_ENCODE);
  28.                 .
  29.                 . 
  30.                 .
  31.         (in another function)
  32.         if (Stream->x_op == XDR_ENCODE) {
  33.                 if (*Pointer != NULL) {
  34.                         if (! xdr_bool (Stream, &NonNil))   <=== Bus error
  35.                                 return -1;
  36.                         Next = 0;
  37.                         if (DescriptionLoop (
  38.                                 Stream, Description, Descriptor, Pointer, &Next)
  39.                             == -1)
  40.                                 return -1;
  41.                 }
  42.                 .
  43.                 .
  44.                 .
  45.  
  46. Some more info:
  47. 1.      The xdr_bool does the first write to the XDR stream, so it's very
  48.         probable that something's wrong with the stream.
  49. 2.      The malloc for Buffer was ok, there should be enough memory for
  50.         the stream.
  51. 3.      The Stream and NonNil variables seem to be ok, too.
  52.  
  53. I'm totally clueless. The routines have been heavily used on a NeXT without
  54. any problem, but on a Sun4 (and IPX) they never make it beyond that point.
  55.  
  56. Any ideas are greatly apreciated.
  57.  
  58.  
  59. Frank
  60.