+1999-04-14 <tytso@rsts-11.mit.edu>
+
+ * svc.c (svc_getreq, svc_getreqset): Avoid using internal, private
+ fd_set structure elements (Needed for Linux/glibc 2.1)
+
Thu Apr 1 19:11:50 1999 Tom Yu <tlyu@mit.edu>
* rpc_commondata.c: Add initializers to prevent lossage on systems
#ifdef FD_SETSIZE
static SVCXPRT **xports;
+static int max_xport = 0;
#else
#define NOFILE 32
if (sock < _gssrpc_rpc_dtablesize()) {
xports[sock] = xprt;
FD_SET(sock, &svc_fdset);
+ if (max_xport < sock)
+ max_xport = sock;
}
#else
if (sock < NOFILE) {
if ((sock < _gssrpc_rpc_dtablesize()) && (xports[sock] == xprt)) {
xports[sock] = (SVCXPRT *)0;
FD_CLR(sock, &svc_fdset);
+ if (max_xport = sock) {
+ while ((max_xport > 0) && xports[max_xport] == 0)
+ max_xport--;
+ }
}
#else
if ((sock < NOFILE) && (xports[sock] == xprt)) {
{
#ifdef FD_SETSIZE
fd_set readfds;
+ int i, mask;
FD_ZERO(&readfds);
- readfds.fds_bits[0] = rdfds;
+ for (i=0, mask=1; rdfds; i++, mask <<=1) {
+ if (rdfds & mask)
+ FD_SET(i, &readfds);
+ rdfds &= ~mask;
+ }
svc_getreqset(&readfds);
#else
int readfds = rdfds & svc_fds;
rpc_u_int32 mask;
int bit;
rpc_u_int32 *maskp;
- register int setsize;
register int sock;
bool_t no_dispatch;
r.rq_clntcred = &(cred_area[2*MAX_AUTH_BYTES]);
#ifdef FD_SETSIZE
- setsize = _gssrpc_rpc_dtablesize();
-
- maskp = (rpc_u_int32 *)readfds->fds_bits;
- for (sock = 0; sock < setsize; sock += NFDBITS) {
- for (mask = *maskp++; bit = ffs(mask); mask ^= (1 << (bit - 1))) {
+ for (sock = 0; sock <= max_xport; sock++) {
+ if (FD_ISSET(sock, readfds)) {
/* sock has input waiting */
xprt = xports[sock + bit - 1];
#else