| @@ -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 |
294 | extern int svc_maxfd; | | 294 | extern int svc_maxfd; |
295 | extern fd_set svc_fdset; | | 295 | extern 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 |
308 | extern void rpctest_service(void); | | 310 | extern 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 */ |
314 | extern void svc_fdset_init(int); | | 317 | extern void svc_fdset_init(int); |
315 | extern fd_set *svc_fdset_copy(const fd_set *); | | 318 | |
316 | | | 319 | |
317 | extern void svc_fdset_zero(void); | | 320 | extern void svc_fdset_zero(void); |
318 | extern int svc_fdset_isset(int); | | 321 | extern int svc_fdset_isset(int); |
319 | extern int svc_fdset_clr(int); | | 322 | extern int svc_fdset_clr(int); |
320 | extern int svc_fdset_set(int); | | 323 | extern int svc_fdset_set(int); |
321 | | | 324 | |
322 | extern fd_set *svc_fdset_get(void); | | 325 | extern fd_set *svc_fdset_get(void); |
323 | extern int svc_fdset_getsize(int); | | 326 | extern int svc_fdset_getsize(int); |
324 | extern int *svc_fdset_getmax(void); | | 327 | extern int *svc_fdset_getmax(void); |
| | | 328 | extern fd_set *svc_fdset_copy(const fd_set *); |
| | | 329 | |
| | | 330 | extern struct pollfd *svc_pollfd_get(void); |
| | | 331 | extern int svc_pollfd_getsize(int); |
| | | 332 | extern int *svc_pollfd_getmax(void); |
| | | 333 | extern struct pollfd *svc_pollfd_copy(const struct pollfd *); |
325 | | | 334 | |
326 | extern void svc_getreq (int); | | 335 | extern void svc_getreq (int); |
327 | extern void svc_getreqset (fd_set *); | | 336 | extern void svc_getreqset (fd_set *); |
328 | extern void svc_getreqset2 (fd_set *, int); | | 337 | extern void svc_getreqset2 (fd_set *, int); |
329 | extern void svc_getreq_common (int); | | 338 | extern void svc_getreq_common (int); |
330 | struct pollfd; | | 339 | struct pollfd; |
331 | extern void svc_getreq_poll(struct pollfd *, int); | | 340 | extern void svc_getreq_poll(struct pollfd *, int); |
332 | | | 341 | |
333 | extern void svc_run (void); | | 342 | extern void svc_run (void); |
334 | extern void svc_exit (void); | | 343 | extern void svc_exit (void); |
335 | __END_DECLS | | 344 | __END_DECLS |
336 | | | 345 | |
337 | /* | | 346 | /* |