Re: HELP: select() under sockets


Michael T. Stolarchuk (mts@emptys.cc.umich.edu)
Tue, 08 Sep 87 21:00:15 EDT


        Umm, I just looked into /usr/include/stdio.h on our apollo system:

            Changelog entry:
                10/01/82 jrw increased _NFILE from 20 to 128.....

        So using NFILE is probably NOT the way to go, unless you declare
        readfds, et al as arrays (this leads one to wonder, of course, why
        the existing apollo software works at all -- since I know of no code
        that actually uses arrays with select. Probably because no one actually
        opens more than 32 file descriptors and only THEN creates a socket...).

 How about 4.3? Where select is:

        nfound = select(nfds, readfds, writefds, exceptfds, timeout)
                int nfound, nfds;
                fd_set *readfds, *writefds, *exceptfds;
                struct timeval *timeout;

 And you have:
        FD_SET(fd, &fdset)
        FD_CLR(fd, &fdset)
        FD_ISSET(fd, &fdset)
        FD_ZERO(&fdset)

 And fd_set is:
        typedef struct fd_set {
                fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
                } fd_set;

 And FD_SETSIZE is 256.

mts. the snail. imagine him at 100 mhp.



This archive was generated by hypermail 2.0b3 on Thu Mar 09 2000 - 14:39:15 GMT