#include <rpc/rpc.h>
void clnt_geterr(const CLIENT *clnt,
struct rpc_err *errp);
The clnt_geterr() function copies the error structure out of the client handle to the structure at address errp.
No authorization is required.
None.
When an exception occurs, clnt_geterr() tries to set RPC_INTR in the client handle. This status can be retrieved by another valid clnt_geterr() call. If the attempt was unsuccessful, no error indication is given.
| 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_geterr() is used:
#include <stdio.h>
#include <rpc/rpc.h>
#include <sys/time.h>
main()
{
u_long procnum;
CLIENT *clnt;
enum clnt_stat cs;
struct rpc_err client_error;
struct timeval total_timeout;
int intsend, intrecv;
...
/* Call the remote procedure that is associated with client */
cs = clnt_call(clnt, procnum, xdr_int,
(caddr_t)&intsend, xdr_int,
(caddr_t)&intrecv, total_timeout);
if (cs != RPC_SUCCESS){
clnt_geterr(clnt,&client_error);
...
exit(1);
}
}
| Top | Remote Procedure Call (RPC) APIs | APIs by category |