From: hno <> Date: Sat, 5 Jan 2002 11:34:42 +0000 (+0000) Subject: Miquel van Smoorenburg's hack for many filedescriptors on Linux without X-Git-Tag: SQUID_3_0_PRE1~1221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6780b62edca7c2c5f84bc1d3fb7679f99b3b174f;p=thirdparty%2Fsquid.git Miquel van Smoorenburg's hack for many filedescriptors on Linux without messing around with the system headers. --- diff --git a/src/squid.h b/src/squid.h index 4e7f84a3d9..cd05eed0a9 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.216 2001/11/13 19:25:08 hno Exp $ + * $Id: squid.h,v 1.217 2002/01/05 04:34:42 hno Exp $ * * AUTHOR: Duane Wessels * @@ -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 0 +# 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 /*