Exception: Windows uses an array[FD_SETSIZE] of handles, so the value of individual handles is irrelevant. I don't know what other exceptions there might be.
Any comments? Yeah, the error code sucks. APR_ENOPOLL? APR_ENOSOCKET?
Anybody running a super-threaded httpd MPM on a box without poll()? Apache httpd's MPMs for Unix will stop bailing out for client connections using a socket fd >= FD_SETSIZE. They do it now just in case the platform has no poll(), but it is doubtful that more than a handful of people really need that check, and hopefully an apr patch like this one will be sufficient to convince such people that they should lower the threads or otherwise reduce the fds open in the process. (They had to do that anyway when httpd performed the check.)
Index: poll/unix/poll.c =================================================================== RCS file: /home/cvs/apr/poll/unix/poll.c,v retrieving revision 1.42 diff -u -r1.42 poll.c --- poll/unix/poll.c 22 Nov 2003 10:53:46 -0000 1.42 +++ poll/unix/poll.c 26 Jan 2004 23:07:34 -0000 @@ -248,6 +248,12 @@ else { break; } +#if !defined(WIN32) /* socket sets handled with array of handles */ + if (fd >= FD_SETSIZE) { + /* XXX invent new error code so application has a clue */ + return APR_EBADF; + } +#endif if (aprset[i].reqevents & APR_POLLIN) { FD_SET(fd, &readset); } @@ -425,6 +431,12 @@ #endif #endif } +#if !defined(WIN32) /* socket sets handled with array of handles */ + if (fd >= FD_SETSIZE) { + /* XXX invent new error code so application has a clue */ + return APR_EBADF; + } +#endif if (descriptor->reqevents & APR_POLLIN) { FD_SET(fd, &(pollset->readset)); }