[comp.unix.questions] returning NULL pointer values via rpc/xdr

BACON@MTUS5.BITNET (Jeffery Bacon) (07/21/90)

(Maybe this isn't the place, but I imagine that there are people here who
know the answer too, and comp.protocols.nfs didn't seem right either.)

Let's suppose I have this function, char *blaoog(), that does whatever.
Now I want to put this into an rpc enviroment. So I rpcgen some code, and
write a little wrapper for the rpcgen'ned client code such that I can link
the appropriate object file and just call blaoog() as if it were local.
No problem. (Well, I didn't exactly rpcgen the code, but you get the idea.)

Now let's suppose that I wanted blaoog() to return a NULL pointer. Not too
uncommon, I wouldn't think. But how would you do it? The way I RTFM, it looks
like blaoog() HAS to return SOMETHING on the server side, otherwise boom. (I
also observe this in practice.) Right now, I have blaoog() on the server side
return a dummy value that blaoog() on the client side looks for as a signal
to return the appropriate NULL poiner. But this seems awfully kludgy if
you ask me. Is this the only way to do it? Or am I missing something? Or are
all of you horribly confused because I'm a rotten explainer?

Thanks.

Jeffery Bacon -- Computing Technology Svcs., Michigan Technological University
email- bacon@mtus5.bitnet       voice: (906)487-2110        fax: (906)487-2787
alternate-  uucp: <world>!itivax!anet!bacos  domain: bacos%anet@itivax.iti.org