svc_fds, svc_fdset, svc_freeargs, svc_getargs, svc_getcaller,
svc_getreq, svc_getreqset, svc_getcaller, svc_run, svc_sendreply -
library routines for RPC servers
RPC routines allow C programs to make procedure calls on other machines
across the network. First, the client calls a procedure 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. Finally, the procedure call returns to the client.
These routines are associated with the server side of the RPC mecha-
nism. Some of them are called by the server side dispatch function,
while others (such as svc_run()) are called when the server is initi-
The SVCXPRT data structure is defined in the RPC/XDR Library Defini-
tions of the
Similar to svc_fdset, but limited to 32 descriptors. This inter-
face is obsoleted by svc_fdset.
A global variable reflecting the RPC server's read file descrip-
tor bit mask; it is suitable as a parameter to the select() sys-
tem call. This is only of interest if a service implementor does
not call svc_run(), but rather does their own asynchronous event
processing. This variable is read-only (do not pass its address
to select()!), yet it may change after calls to svc_getreqset()
or any creation routines.
bool_t svc_freeargs(xprt, inproc, in)
Free any data allocated by the RPC/XDR system when it decoded
the arguments to a service procedure using svc_getargs(). This
routine returns TRUE if the results were successfully freed, and
bool_t svc_getargs(xprt, inproc, in)
Decode the arguments of an RPC request associated with the RPC
service transport handle, xprt. The parameter in is the address
where the arguments will be placed; inproc is the XDR routine
used to decode the arguments. This routine returns TRUE if
decoding succeeds, and FALSE otherwise.
struct sockaddr_in * svc_getcaller(xprt)
The approved way of getting the network address of the caller of
a procedure associated with the RPC service transport handle,
Similar to svc_getreqset(), but limited to 32 descriptors. This
interface is obsoleted by svc_getreqset().
This routine is only of interest if a service implementor does
not use svc_run(), but instead implements custom asynchronous
event processing. It is called when the select() system call
has determined that an RPC request has arrived on some RPC
socket(s) ; rdfdsp is the resultant read file descriptor bit
mask. The routine returns when all sockets associated with the
value of rdfdsp have been serviced.
Normally, this routine only returns in the case of some errors.
It waits for RPC requests to arrive, and calls the appropriate
service procedure using svc_getreq() when one arrives. This pro-
cedure is usually waiting for a select() system call to return.
bool_t svc_sendreply(xprt, outproc, out)
Called by an RPC service's dispatch routine to send the results
of a remote procedure call. The parameter xprt is the request's
associated transport handle; outproc is the XDR routine which is
used to encode the results; and out is the address of the
results. This routine returns TRUE if it succeeds, FALSE other-
select(2), rpc(3N), rpc_svc_calls(3N), rpc_svc_create(3N),
20 January 1990 RPC_SVC_REG(3N)