From 099a6fbd8a703336c73f6bb7396b77e4a6e31a3e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 28 Jun 1998 09:50:12 +0000 Subject: Update. * sunrpc/clnt_tcp.c (readtcp): Use poll instead of select. * sunrpc/pmap_rmt.c (clnt_broadcast): Likewise. * sunrpc/clnt_udp.c (clntudp_call): Likewise. Patches from FreeBSD current. 1998-06-28 Andreas Jaeger --- sunrpc/clnt_udp.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'sunrpc/clnt_udp.c') diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c index c3545db65a..1e2fe657d9 100644 --- a/sunrpc/clnt_udp.c +++ b/sunrpc/clnt_udp.c @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; #include #include #include +#include #include #include #include @@ -234,13 +235,9 @@ clntudp_call (cl, proc, xargs, argsp, xresults, resultsp, utimeout) int outlen = 0; int inlen; socklen_t fromlen; -#ifdef FD_SETSIZE - fd_set readfds; - fd_set mask; -#else - int readfds; - int mask; -#endif /* def FD_SETSIZE */ + struct pollfd fd; + int milliseconds = (cu->cu_wait.tv_sec * 1000) + + (cu->cu_wait.tv_usec / 1000); struct sockaddr_in from; struct rpc_msg reply_msg; XDR reply_xdrs; @@ -301,18 +298,11 @@ send_again: reply_msg.acpted_rply.ar_verf = _null_auth; reply_msg.acpted_rply.ar_results.where = resultsp; reply_msg.acpted_rply.ar_results.proc = xresults; -#ifdef FD_SETSIZE - FD_ZERO (&mask); - FD_SET (cu->cu_sock, &mask); -#else - mask = 1 << cu->cu_sock; -#endif /* def FD_SETSIZE */ + fd.fd = cu->cu_sock; + fd.events = POLLIN; for (;;) { - struct timeval cu_wait = cu->cu_wait; - readfds = mask; - switch (select (_rpc_dtablesize (), &readfds, (fd_set*) NULL, - (fd_set*) NULL, &cu_wait)) + switch (__poll(&fd, 1, milliseconds)) { case 0: -- cgit v1.2.3