apache1.3.37 で、FD_SETSIZE 関連のエラー

CentOS 4で、非常に多数の virtual_host を設定している場合、

[Sat Aug 11 08:26:17 2007] [warn] make_sock: problem listening on port 443, filedescriptor (1217) larger than FD_SETSIZE (1024) found, you probably need to rebuild Apache with a larger FD_SETSIZE

のようなエラーが出ることがある。apache_1.3.37のソースを見てもどこにも、FD_SETSIZEを1024に設定していない。

export CFLAGS=" -DFD_SETSIZE=4096"
./configure 

してもエラーは1024のまま。

どうやら、/usr/include/bits/typesizes.h の中の値が効いている模様。

/* Number of descriptors that can fit in an `fd_set'.  */
#define __FD_SETSIZE            1024

この値を変更して、再コンパイルしたら解決した。