--- ./src/squid.h.org Thu Feb 22 22:39:14 2001 +++ ./src/squid.h Sun Feb 3 16:43:40 2002 @@ -45,10 +45,24 @@ */ #define CHANGE_FD_SETSIZE 1 -/* Cannot increase FD_SETSIZE on Linux */ +/* + * Cannot increase FD_SETSIZE on Linux, but we can increase __FD_SETSIZE + * with glibc 2.2 (or later? remains to be seen). We do this by including + * bits/types.h which defines __FD_SETSIZE first, then we redefine + * FD_SETSIZE. Ofcourse a user program may NEVER include bits/whatever.h + * directly, so this is a dirty hack! + */ #if defined(_SQUID_LINUX_) -#undef CHANGE_FD_SETSIZE -#define CHANGE_FD_SETSIZE 0 +# undef CHANGE_FD_SETSIZE +# define CHANGE_FD_SETSIZE 1 +# include +# if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) +# if SQUID_MAXFD > DEFAULT_FD_SETSIZE +# include +# undef __FD_SETSIZE +# define __FD_SETSIZE SQUID_MAXFD +# endif +# endif #endif /* --- ./configure.in.org Sun Feb 3 16:07:10 2002 +++ ./configure.in Sun Feb 3 16:30:31 2002 @@ -1436,7 +1436,7 @@ exit(0); } ], -SQUID_MAXFD=`cat conftestval`, +SQUID_MAXFD=4096, SQUID_MAXFD=256, SQUID_MAXFD=256) AC_MSG_RESULT($SQUID_MAXFD)