>i'm debugging some simple rpcgen created rpc stuff and would
>value any advice on how to go about debugging rpc applications
>from those who've been there already. i'll give you some
>idea of my problem;
>my server function
>x_y_1_svc(bp_x_arg *x, struct svc_req *unused)
> static bp_x_arg res;
> /* set values in res */
> return res;
>looks ok from the server side. the values make sence
>etc. but when called from the client side of the rpc
> res = xproc_y_1(&arg, clnt);
>res is 0 and i get the helpful message that
>there was an `RPC: Remote system error'. via
>thanks for any suggestions.
I think you are confusing the "old" and "new" style service routines.
Are you using the -N argument to rpcgen? It looks like it.
In the "old" style service routines there is a single struct for input and
the results are a pointer to a structure, which the function return value.
Hence the need to make this structure static.
In the "new" style, multiple input arguments are possible and the results
are returned in a structure, a pointer to which is passed as an argument
to the service routine.
The service routine prototype you have given is of the "new" type,
but you are creating a static result structure and returning its pointer
as per the "old" type. The new type service routines end in _svc and are
passed the "struct svc_req *" parameter.
From the prototype I would guess that the call has no input and returns
a single bp_x_arg structure? What you need to do is remove the static
declaration, and set the return values in x rather than res.
Then return a value of TRUE (a bool_t value) which indicates that the
call is ok and a result should be returned to the caller.
x_y_1_svc(bp_x_arg *x, struct svc_req *unused)
/* set values in x */
x->? = something;
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555