RPC_SVC_CALLS(3) | Library Functions Manual | RPC_SVC_CALLS(3) |
svc_dg_enablecache
,
svc_exit
, svc_fdset
,
svc_freeargs
, svc_getargs
,
svc_getreq_common
,
svc_getreq_poll
,
svc_getreqset
,
svc_getrpccaller
,
svc_pollset
, svc_run
,
svc_sendreply
— library
routines for RPC servers
#include
<rpc/rpc.h>
int
svc_dg_enablecache
(SVCXPRT
*xprt, const unsigned
cache_size);
void
svc_exit
(void);
bool_t
svc_freeargs
(const
SVCXPRT *xprt, const
xdrproc_t inproc, caddr_t
in);
bool_t
svc_getargs
(const
SVCXPRT *xprt, const
xdrproc_t inproc, caddr_t
in);
void
svc_getreq_common
(const
int fd);
void
svc_getreq_poll
(struct
pollfd *pfdp, const int
pollretval);
void
svc_getreqset
(fd_set
* rdfds);
struct netbuf *
svc_getrpccaller
(const
SVCXPRT *xprt);
struct cmsgcred *
__svc_getcallercreds
(const
SVCXPRT *xprt);
struct pollfd svc_pollset[FD_SETSIZE];
void
svc_run
(void);
bool_t
svc_sendreply
(SVCXPRT
*xprt, xdrproc_t
outproc, char
*out);
These routines are part of the RPC library which allows C language programs to make procedure calls on other machines across the network.
These routines are associated with the server side of
the RPC mechanism. Some of them are called by the server side dispatch
function, while others (such as
svc_run
())
are called when the server is initiated.
See rpc(3) for the definition of the SVCXPRT data structure.
svc_dg_enablecache
()svc_exit
()svc_run
() to return.
As currently implemented,
svc_exit
()
zeroes the svc_fdset global variable. If RPC
server activity is to be resumed, services must be reregistered with the
RPC library either through one of the
rpc_svc_create(3) functions, or using
xprt_register
().
The svc_exit
() function has global scope and
ends all RPC server activity.
svc_run
(), but rather do their own asynchronous
event processing. This variable is read-only (do not pass its address to
select(2)!), yet it may change after calls to
svc_getreqset
()
or any creation routines.svc_freeargs
()svc_getargs
().
This routine returns TRUE
if the results were
successfully freed, and FALSE
otherwise.svc_getargs
()TRUE
if
decoding succeeds, and FALSE
otherwise.svc_getreq_common
()svc_getreq_poll
()svc_run
(), but instead implements custom
asynchronous event processing. It is called when poll(2)
has determined that an RPC request has arrived on some RPC file
descriptors; pollretval is the return value from
poll(2) and pfdp is the array of
pollfd structures on which the
poll(2) was done. It is assumed to be an array large
enough to contain the maximal number of descriptors allowed.svc_getreqset
()svc_run
(), but instead implements custom
asynchronous event processing. It is called when poll(2)
has determined that an RPC request has arrived on some RPC file
descriptors; rdfds is the resultant read file
descriptor bit mask. The routine returns when all file descriptors
associated with the value of rdfds have been
serviced.svc_getrpccaller
()__svc_getcallercreds
()<sys/socket.h>
,
identifying the calling client. This only works if the client is calling
the server over an AF_LOCAL
socket.svc_run
().
Service implementors who do not call svc_run
() and
who wish to use this array must perform this derivation themselves.svc_run
()svc_getreq_poll
() when one arrives. This procedure
is usually waiting for the poll(2) system call to
return.svc_sendreply
()TRUE
if it succeeds,
FALSE
otherwise.These functions are part of libtirpc.
poll(2), select(2), rpc(3), rpc_svc_create(3), rpc_svc_err(3), rpc_svc_reg(3)
May 3, 1993 | Debian |