1 .\" @(#)rpc_svc_calls.3n 1.28 93/05/10 SMI; from SVr4
2 .\" Copyright 1989 AT&T
3 .\" @(#)rpc_svc_calls 1.5 89/07/25 SMI;
4 .\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
5 .\" $NetBSD: rpc_svc_calls.3,v 1.1 2000/06/02 23:11:13 fvdl Exp $
6 .\" $FreeBSD: src/lib/libc/rpc/rpc_svc_calls.3,v 1.10 2005/11/23 16:44:23 ru Exp $
11 .Nm svc_dg_enablecache ,
16 .Nm svc_getreq_common ,
19 .Nm svc_getrpccaller ,
23 .Nd library routines for RPC servers
29 .Fn svc_dg_enablecache "SVCXPRT *xprt" "const unsigned cache_size"
33 .Fn svc_freeargs "const SVCXPRT *xprt" "const xdrproc_t inproc" "caddr_t in"
35 .Fn svc_getargs "const SVCXPRT *xprt" "const xdrproc_t inproc" "caddr_t in"
37 .Fn svc_getreq_common "const int fd"
39 .Fn svc_getreq_poll "struct pollfd *pfdp" "const int pollretval"
41 .Fn svc_getreqset "fd_set * rdfds"
43 .Fn svc_getrpccaller "const SVCXPRT *xprt"
44 .Vt struct pollfd svc_pollset[FD_SETSIZE];
48 .Fn svc_sendreply "SVCXPRT *xprt" "xdrproc_t outproc" "void *out"
50 These routines are part of the
52 library which allows C language programs to make procedure
53 calls on other machines across the network.
55 These routines are associated with the server side of the
57 Some of them are called by the server side dispatch function,
61 are called when the server is initiated.
63 .\" In the current implementation, the service transport handle,
65 .\" contains a single data area for decoding arguments and encoding results.
66 .\" Therefore, this structure cannot be freely shared between threads that call
67 .\" functions that do this.
68 .\" Routines on this page that are affected by this
69 .\" restriction are marked as unsafe for MT applications.
73 for the definition of the
76 .Bl -tag -width ".Fn svc_dg_enablecache"
77 .It Fn svc_dg_enablecache
78 This function allocates a duplicate request cache for the
84 Once enabled, there is no way to disable caching.
85 This routine returns 0 if space necessary for a cache of the given size
86 was successfully allocated, and 1 otherwise.
88 This function, when called by any of the RPC server procedure or
93 As currently implemented,
98 If RPC server activity is to be resumed,
99 services must be reregistered with the RPC library
100 either through one of the
107 has global scope and ends all RPC server activity.
109 .Vt fd_set Va svc_fdset
111 A global variable reflecting the
112 RPC server's read file descriptor bit mask; it is suitable as an argument
116 This is only of interest
117 if service implementors do not call
119 but rather do their own asynchronous event processing.
120 This variable is read-only (do not pass its address to
122 yet it may change after calls to
124 or any creation routines.
126 A function macro that frees any data allocated by the
127 RPC/XDR system when it decoded the arguments to a service procedure
132 if the results were successfully
137 A function macro that decodes the arguments of an
138 RPC request associated with the RPC
139 service transport handle
144 is the address where the arguments will be placed;
147 routine used to decode the arguments.
150 if decoding succeeds, and
153 .It Fn svc_getreq_common
154 This routine is called to handle a request on the given
156 .It Fn svc_getreq_poll
157 This routine is only of interest if a service implementor
160 but instead implements custom asynchronous event processing.
163 has determined that an RPC request has arrived on some RPC
166 is the return value from
172 structures on which the
175 It is assumed to be an array large enough to
176 contain the maximal number of descriptors allowed.
178 This routine is only of interest if a service implementor
181 but instead implements custom asynchronous event processing.
184 has determined that an RPC
185 request has arrived on some RPC file descriptors;
187 is the resultant read file descriptor bit mask.
188 The routine returns when all file descriptors
189 associated with the value of
192 .It Fn svc_getrpccaller
193 The approved way of getting the network address of the caller
194 of a procedure associated with the
195 RPC service transport handle
198 .Vt struct pollfd Va svc_pollset[FD_SETSIZE] ;
203 structures derived from
205 It is suitable as an argument to the
212 is made in the current implementation in
214 Service implementors who do not call
216 and who wish to use this array must perform this derivation themselves.
218 This routine never returns.
220 requests to arrive, and calls the appropriate service
224 This procedure is usually waiting for the
226 system call to return.
228 Called by an RPC service's dispatch routine to send the results of a
229 remote procedure call.
233 is the request's associated transport handle;
236 routine which is used to encode the results; and
238 is the address of the results.
249 .Xr rpc_svc_create 3 ,