Re: FD_SETSIZE

From: Jonathan Larmour <[email protected]>
Date: Mon, 25 Nov 1996 21:01:32 +0000

At 17:24 25/11/96 +0000, Ernest Yik wrote:
>I have patched my linux 2.0.23 kernel according to
>www.linux.org.za/tweak.html, setting FD_SETSIZE to 2048. Now whenever I
>compile squid, warnings about redefining FD_SETSIZE will appear. There is
>no warning when FD_SETSIZE is changed to SQUID_MAXFD in squid1.1b21, but
>starting from b22 it is changed back to FD_SETSIZE.

Quick fix: in squid.h remove the lines where it redefines FD_SETSIZE. Then
underneath all the includes do a #define FD_SETSIZE SQUID_MAXFD
make clean, and ignore the warnings from now on.

>Should I just ignore these warnings, or I've done something wrong with my
>kernel patching? Thanks for all information.

Nope. It appears there are differences in the use of FD_SETSIZE between
OS's. Some define it to be less than they can actually cope with. Some
define it to be more than they cope with per-process.

The proper solution AFAICT is for Duane to make it OS-specific, since
nothing else can accurately tell. And don't use FD_SETSIZE to determine how
many files can be opened - instead use SQUID_MAXFD. i.e. do #ifdef
_SQUID_LINUX_ or suchlike. The alternative is that squid under some OS's may
break depending on how badly squid reacts to suddenly running out of
descriptors without notice.

Jonathan L.
Origin IT Services Ltd., 323 Cambridge Science Park, Cambridge, England.
Tel: +44 (1223) 423355 Fax: +44 (1223) 420724 E-mail: guess...
-------[ Do not think that every sad-eyed woman has loved and lost... ]------
-----------------------[ she may have got him. -Anon ]-----------------------
These opinions are all my own fault.
Received on Mon Nov 25 1996 - 13:04:15 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:33:38 MST