I'm seeking a sponsor for the following change to 
/usr/src/cmd/cmd-inet/usr.bin/telnet/sys_bsd.c for telnet(1):

--- sys_bsd.c   Sun Jun 12 16:00:08 2005
+++ sys_bsd.c.fixed     Mon May  1 19:18:16 2006
@@ -756,2 +756,3 @@
         register int c;
+       int nfds = 0;
         /*
@@ -768,2 +769,4 @@
                 FD_SET(net, &obits);
+               if (nfds < net + 1)
+                       nfds = net + 1;
         }
@@ -771,2 +774,4 @@
                 FD_SET(tout, &obits);
+               if (nfds < tout + 1)
+                       nfds = tout + 1;
         }
@@ -774,2 +779,4 @@
                 FD_SET(tin, &ibits);
+               if (nfds < tin + 1)
+                       nfds = tin + 1;
         }
@@ -781,3 +788,3 @@
         }
-       if ((c = select(16, &ibits, &obits, &xbits,
+       if ((c = select(nfds, &ibits, &obits, &xbits,
                         (poll == 0) ? NULL : &TimeValue)) < 0) {

The above modifies sys_bsd.c to work with file descriptors > 15. A 
potentially superior but more invasive approach would be to switch from 
select(3C) to poll(2).

Reply via email to