分类:
2008-10-13 16:11:00
1、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 (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
#include
#undef __FD_SETSIZE
#define __FD_SETSIZE SQUID_MAXFD
#endif
2、FreeBsd
Cannot increase FD_SETSIZE on FreeBSD before 2.2.0, causes select(2)
to return EINVAL.
3、Mac OS X Server
Trying to redefine CHANGE_FD_SETSIZE causes a slew of warnings
on Mac OS X Server.
其他的大部分平台基本上都可以重定义FD_SETSIZE(当然包括winnt系列了)