home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!Sirius.dfn.de!zrz.tu-berlin.de!opal.cs.tu-berlin.de!mauriti
- From: mauriti@cs.tu-berlin.de (Frank Hartlep)
- Subject: Sun's XDR routines won't work on Sun machines ...
- Message-ID: <WRU6L3V@mailgzrz.tu-berlin.de>
- Sender: news@mailgzrz.tu-berlin.de (News Manager)
- Nntp-Posting-Host: gorisa.cs.tu-berlin.de
- Organization: Technical University of Berlin, Germany
- Date: Wed, 9 Sep 1992 13:43:13 GMT
- Lines: 45
-
-
- ... although they do on a NeXT.
- Perhaps somebody can see an error in this code.
-
- .
- .
- .
-
- BufferSize += 50000;
- Buffer = malloc (BufferSize);
- Offset = strlen (ARCHIVED) + strlen (Description) + 1 + 4;
- sprintf (Buffer, ARCHIVED "%s", Description);
- xdrmem_create (&Stream, Buffer + Offset, BufferSize - Offset, XDR_ENCODE);
- .
- .
- .
- (in another function)
- if (Stream->x_op == XDR_ENCODE) {
- if (*Pointer != NULL) {
- if (! xdr_bool (Stream, &NonNil)) <=== Bus error
- return -1;
- Next = 0;
- if (DescriptionLoop (
- Stream, Description, Descriptor, Pointer, &Next)
- == -1)
- return -1;
- }
- .
- .
- .
-
- Some more info:
- 1. The xdr_bool does the first write to the XDR stream, so it's very
- probable that something's wrong with the stream.
- 2. The malloc for Buffer was ok, there should be enough memory for
- the stream.
- 3. The Stream and NonNil variables seem to be ok, too.
-
- I'm totally clueless. The routines have been heavily used on a NeXT without
- any problem, but on a Sun4 (and IPX) they never make it beyond that point.
-
- Any ideas are greatly apreciated.
-
-
- Frank
-