summaryrefslogtreecommitdiff
path: root/include/rpc/svc.h
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-12-31 03:27:24 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-12-31 03:27:24 +0000
commit23f499490dbfd44837b6e8444733b39e8577d76f (patch)
tree36e51f78cf130e80aa8a9bfc92190cd065ce4098 /include/rpc/svc.h
parent8d7e31dc1a81c4e63b4f5022186f2a529198c3ac (diff)
Implement svc_getreq_poll(3) and friends and use poll(2) instead of select(2)
in the libc rpc code. The main difference between this and the previous version is the use of a simple free list that simplifies the logic when adding a socket to svc_pollfd. I've also added code to pack svc_pollfd when the free list gets too big. The idea general idea is to keep svc_pollfd as tightly packed as possible to make poll(2) efficient. Tested by many people and OK deraadt@
Diffstat (limited to 'include/rpc/svc.h')
-rw-r--r--include/rpc/svc.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/rpc/svc.h b/include/rpc/svc.h
index d41951bcbbf..717a27c73cb 100644
--- a/include/rpc/svc.h
+++ b/include/rpc/svc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: svc.h,v 1.7 2002/02/17 19:42:21 millert Exp $ */
+/* $OpenBSD: svc.h,v 1.8 2003/12/31 03:27:23 millert Exp $ */
/* $NetBSD: svc.h,v 1.9 1995/04/29 05:28:01 cgd Exp $ */
/*
@@ -42,6 +42,7 @@
#ifndef _RPC_SVC_H
#define _RPC_SVC_H
#include <sys/cdefs.h>
+#include <sys/poll.h>
/*
* This interface must manage two items concerning remote procedure calling:
@@ -260,13 +261,11 @@ __END_DECLS
* Global keeper of rpc service descriptors in use
* dynamic; must be inspected before each call to select
*/
-extern int svc_maxfd;
-#ifdef FD_SETSIZE
extern fd_set svc_fdset;
#define svc_fds svc_fdset.fds_bits[0] /* compatibility */
-#else
-extern int svc_fds;
-#endif /* def FD_SETSIZE */
+extern struct pollfd *svc_pollfd;
+extern int svc_max_pollfd;
+extern int svc_maxfd; /* non-standard */
/*
* a small program implemented by the svc_rpc implementation itself;
@@ -276,6 +275,8 @@ extern void rpctest_service(); /* XXX relic? */
__BEGIN_DECLS
extern void svc_getreq(int);
+extern void svc_getreq_common(int);
+extern void svc_getreq_poll(struct pollfd *, const int);
extern void svc_getreqset(fd_set *);
extern void svc_getreqset2(fd_set *, int);
extern void svc_run(void);