#include <rpc/rpc.h>
bool_t clnt_freeres(CLIENT *clnt,
const xdrproc_t inproc,
caddr_t in);
The clnt_freeres() function frees any data allocated by the RPC or XDR system when it decoded the results of an RPC call.
No authorization is required.
| TRUE (1) | Successful |
| FALSE (0) | Unsuccessful |
This function returns FALSE when the in parameter is NULL or an exception has occurred. In case of an exception, clnt_freeres() tries to set RPC_INTR in the client handle. This status can be retrieved by a call to clnt_geterr().
| Message ID | Error Message Text |
|---|---|
| CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
See Code disclaimer information for information pertaining to code examples.
The following example shows how clnt_freeres() is used:
#include <stdio.h>
#include <rpc/rpc.h>
...
u_long procnum;
CLIENT *clnt;
enum clnt_stat stat;
struct rpc_err client_error;
struct timeval timeout;
struct array_args{
unsigned int size;
char *data;
};
struct array_args args; /* Arg with buffer to send */
struct array_args result; /* Arg with buffer to receive */
...
/* Call the remote procedure that is associated with client */
...
stat = clnt_call(clnt, procnum, (xdrproc_t)xdr_array,
(char *)&args, (xdrproc_t)xdr_array,
(char *)&result, timeout);
if (stat != RPC_SUCCESS){
/* Failure on call */
if (result.data != (char *) NULL){
if(!clnt_freeres(clnt, (xdrproc_t)xdr_array,
(char *)&result))
/* clnt_freeres() failed */
...
}
...
}
| Top | Remote Procedure Call (RPC) APIs | APIs by category |