Sat Nov 7 23:10:38 2015 UTC ()
provide a poll(2) based interface.


(christos)
diff -r1.28 -r1.29 src/include/rpc/svc.h

cvs diff -r1.28 -r1.29 src/include/rpc/svc.h (expand / switch to unified diff)

--- src/include/rpc/svc.h 2015/11/07 16:58:24 1.28
+++ src/include/rpc/svc.h 2015/11/07 23:10:37 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: svc.h,v 1.28 2015/11/07 16:58:24 christos Exp $ */ 1/* $NetBSD: svc.h,v 1.29 2015/11/07 23:10:37 christos Exp $ */
2 2
3/* 3/*
4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
5 * unrestricted use provided that this legend is included on all tape 5 * unrestricted use provided that this legend is included on all tape
6 * media and as a part of the software program in whole or part. Users 6 * media and as a part of the software program in whole or part. Users
7 * may copy or modify Sun RPC without charge, but are not authorized 7 * may copy or modify Sun RPC without charge, but are not authorized
8 * to license or distribute it to anyone else except as part of a product or 8 * to license or distribute it to anyone else except as part of a product or
9 * program developed by the user. 9 * program developed by the user.
10 * 10 *
11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14 * 14 *
@@ -286,52 +286,61 @@ __END_DECLS @@ -286,52 +286,61 @@ __END_DECLS
286 * "in-place" results of a select system call (see select, section 2). 286 * "in-place" results of a select system call (see select, section 2).
287 */ 287 */
288 288
289/* 289/*
290 * Global keeper of rpc service descriptors in use 290 * Global keeper of rpc service descriptors in use
291 * dynamic; must be inspected before each call to select 291 * dynamic; must be inspected before each call to select
292 */ 292 */
293#ifdef SVC_LEGACY 293#ifdef SVC_LEGACY
294extern int svc_maxfd; 294extern int svc_maxfd;
295extern fd_set svc_fdset; 295extern fd_set svc_fdset;
296#else 296#else
297#define svc_maxfd (*svc_fdset_getmax()) 297#define svc_maxfd (*svc_fdset_getmax())
298#define svc_fdset (*svc_fdset_get()) 298#define svc_fdset (*svc_fdset_get())
 299#define svc_pollfd svc_pollfd_get()
 300#define svc_max_pollfd (*svc_fdset_getmax())
299#endif 301#endif
300 302
301#define svc_fds svc_fdset.fds_bits[0] /* compatibility */ 303#define svc_fds svc_fdset.fds_bits[0] /* compatibility */
302 304
303/* 305/*
304 * a small program implemented by the svc_rpc implementation itself; 306 * a small program implemented by the svc_rpc implementation itself;
305 * also see clnt.h for protocol numbers. 307 * also see clnt.h for protocol numbers.
306 */ 308 */
307__BEGIN_DECLS 309__BEGIN_DECLS
308extern void rpctest_service(void); 310extern void rpctest_service(void);
309__END_DECLS 311__END_DECLS
310 312
311__BEGIN_DECLS 313__BEGIN_DECLS
312 314
313#define SVC_FDSET_MT 1 315#define SVC_FDSET_MT 1 /* each thread gets own fd_set/pollfd */
 316#define SVC_FDSET_POLL 2 /* use poll in svc_run */
314extern void svc_fdset_init(int); 317extern void svc_fdset_init(int);
315extern fd_set *svc_fdset_copy(const fd_set *); 318
316 319
317extern void svc_fdset_zero(void); 320extern void svc_fdset_zero(void);
318extern int svc_fdset_isset(int); 321extern int svc_fdset_isset(int);
319extern int svc_fdset_clr(int); 322extern int svc_fdset_clr(int);
320extern int svc_fdset_set(int); 323extern int svc_fdset_set(int);
321 324
322extern fd_set *svc_fdset_get(void); 325extern fd_set *svc_fdset_get(void);
323extern int svc_fdset_getsize(int); 326extern int svc_fdset_getsize(int);
324extern int *svc_fdset_getmax(void); 327extern int *svc_fdset_getmax(void);
 328extern fd_set *svc_fdset_copy(const fd_set *);
 329
 330extern struct pollfd *svc_pollfd_get(void);
 331extern int svc_pollfd_getsize(int);
 332extern int *svc_pollfd_getmax(void);
 333extern struct pollfd *svc_pollfd_copy(const struct pollfd *);
325 334
326extern void svc_getreq (int); 335extern void svc_getreq (int);
327extern void svc_getreqset (fd_set *); 336extern void svc_getreqset (fd_set *);
328extern void svc_getreqset2 (fd_set *, int); 337extern void svc_getreqset2 (fd_set *, int);
329extern void svc_getreq_common (int); 338extern void svc_getreq_common (int);
330struct pollfd; 339struct pollfd;
331extern void svc_getreq_poll(struct pollfd *, int); 340extern void svc_getreq_poll(struct pollfd *, int);
332 341
333extern void svc_run (void); 342extern void svc_run (void);
334extern void svc_exit (void); 343extern void svc_exit (void);
335__END_DECLS 344__END_DECLS
336 345
337/* 346/*