rpc_clnt_calls(3N)rpc_clnt_calls(3N)NAME
rpc_clnt_calls: clnt_call(), clnt_freeres(), clnt_geterr(), clnt_per‐
rno(), clnt_perror(), clnt_sperrno(), clnt_sperror(), rpc_broadcast(),
rpc_broadcast_exp(), rpc_call() - library routines for client side
calls
SYNOPSISDESCRIPTION
RPC library routines allow C language programs to make procedure calls
on other machines across the network. First, the client calls a proce‐
dure to send a request to the server. Upon receipt of the request, the
server calls a dispatch routine to perform the requested service, and
then sends back a reply.
The and routines handle the client side of the procedure call. The
remaining routines deal with error handling.
Some of the routines take a handle as one of the parameters. A handle
can be created by an RPC creation routine such as (see rpc_clnt_cre‐
ate(3N)).
These routines are safe for use in multithreaded applications. handles
can be shared between threads, however in this implementation requests
by different threads are serialized (that is, the first request will
receive its results before the second request is sent).
The HP-UX implementation of RPC only supports the X/Open Transport
Interface (XTI). Applications that are written using the Transport
Layer Interface (TLI) and wish to use RPC, must convert their applica‐
tion to XTI.
Routines
See rpc(3N) for the definition of the data structure.
A function macro that calls the remote procedure
procnum associated with the client handle, clnt, which is
obtained with an RPC client creation routine such as (see
rpc_clnt_create(3N)). The parameter inproc is the XDR function
used to encode the procedure's parameters, and outproc is the
XDR function used to decode the procedure's results. in is the
address of the procedure's argument(s), and out is the address
of where to place the result(s). tout is the time allowed for
results to be returned, which is overridden by a time-out set
explicitly through (see rpc_clnt_create(3N)).
If the remote call succeeds, the status returned is Otherwise,
an appropriate status is returned.
A function macro that frees any data allocated by the
RPC/XDR system when it decoded the results of an RPC call. The
parameter out is the address of the results, and outproc is the
XDR routine describing the results. This routine returns if the
results were successfully freed; otherwise it returns
A function macro that copies the error structure out of the client
handle to the structure at address errp.
Prints a message to standard error corresponding
to the condition indicated by stat. A newline is appended. It
is normally used after a procedure call fails for a routine for
which a client handle is not needed, for instance
Prints a message to the standard error indicating why an RPC call
failed;
clnt is the handle used to do the call. The message is
prepended with string s and a colon. A newline is appended. It
is normally used after a remote procedure call fails for a rou‐
tine which requires a client handle, for instance
Takes the same arguments as
but instead of sending a message to the standard error indicat‐
ing why an RPC call failed, returns a pointer to a string that
contains the message.
is normally used instead of when the program does not have a
standard error, as a program running as a server quite likely
does not. is also used if the programmer does not want the mes‐
sage to be output with (see printf(3S)), or if a message format
different than that supported by is to be used.
Unlike and (see rpc_clnt_create(3N)), does not return a pointer
to static data. Therefore, the result is not overwritten on
each call.
Similar to
except that like it returns a string instead of printing to
standard error. However, does not append a newline at the end
of the message.
returns a pointer to a buffer that is overwritten on each call.
In multithreaded applications, this buffer is implemented as
thread-specific data.
Similar to
except that the call message is broadcast to all the connection‐
less transports specified by nettype. If nettype is it defaults
to Each time it receives a response, this routine calls whose
form is:
where out is the same as out passed to except that the remote
procedure's output is decoded there; addr points to the address
of the machine that sent the results, and netconf is the netcon‐
fig structure of the transport on which the remote server
responded. If returns waits for more replies; otherwise it
returns with appropriate status.
The broadcast file descriptors are limited in size to the maxi‐
mum transfer size of that transport. For Ethernet, this value
is 1500 bytes. uses credentials by default (see
rpc_clnt_auth(3N)).
Similar to
except that the initial timeout, inittime, and the maximum time‐
out, waittime, are specified in milliseconds.
inittime is the initial time that waits before resending the
request. After the first resend, the re-transmission interval
increases exponentially until it exceeds waittime.
Calls the remote procedure associated with
prognum, versnum, and procnum on the machine, host. The parame‐
ter inproc is used to encode the procedure's parameters, and
outproc is used to decode the procedure's results. in is the
address of the procedure's argument(s), and out is the address
of where to place the result(s). nettype can be any of the val‐
ues listed on rpc(3N). This routine returns if it succeeds, or
it returns an appropriate status. Use the routine to translate
failure status into error messages.
The function uses the first available transport belonging to the
class nettype on which it can create a connection. You do not
have control of timeouts or authentication using this routine.
MULTITHREAD USAGE
Thread Safe: Yes
Cancel Safe: Yes
Fork Safe: No
Async-cancel Safe: No
Async-signal Safe: No
These functions can be called safely in a multithreaded environment.
They may be cancellation points in that they call functions that are
cancel points.
In a multithreaded environment, these functions are not safe to be
called by a child process after and before These functions should not
be called by a multithreaded application that supports asynchronous
cancellation or asynchronous signals.
SEE ALSOprintf(3S), rpc(3N), rpc_clnt_auth(3N), rpc_clnt_create(3N).
rpc_clnt_calls(3N)