diff options
author | Thorsten Kukuk <kukuk@suse.de> | 2015-08-24 10:39:13 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2015-08-28 09:08:19 -0400 |
commit | b2c9430f46c4ac848957fb8adaac176a3f6ac03f (patch) | |
tree | 1ec5caf4057960f45df755459b563a73664be506 /tirpc | |
parent | 1c77f7a869bdea2a34799d774460d1f9983d45f0 (diff) | |
download | ti-rpc-b2c9430f46c4ac848957fb8adaac176a3f6ac03f.tar.gz |
Use poll() instead of select() in svc_run()
TI-RPC is using select() in svc_run(), while glibc and Solaris
are using poll(). This has two drawbacks: poll() is much more efficient
then select(), and with select() we are limited to 1024 open
filehandles.
And applications replacing svc_run on Linux don't work, since they
expect
svc_pollfd and svc_max_pollfd.
Attached patch changes this. It's full backward compatible, API and ABI,
so e.g. current rpcbind will continue to work and compile. The only
problem could arrive, that we can have more than 1024 open filehandles
and applications ignoring higher ones.
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Thorsten Kukuk <kukuk@thkukuk.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'tirpc')
-rw-r--r-- | tirpc/rpc/svc.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tirpc/rpc/svc.h b/tirpc/rpc/svc.h index f647095..1ab6527 100644 --- a/tirpc/rpc/svc.h +++ b/tirpc/rpc/svc.h @@ -315,12 +315,10 @@ extern int rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t, * 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; /* * a small program implemented by the svc_rpc implementation itself; |