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

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