[lkml]   [2001]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Should __FD_SETSIZE still be set to 1024 ?
On Sat, 23 Jun 2001, Chris Wedgwood wrote:

> On Fri, Jun 22, 2001 at 04:59:36PM +0200, Dag Wieers wrote:
> Is there a reason for __FD_SETSIZE to be 1024 in
> linux/posix_types.h and gnu/types.h ?
> Why can't we increase this number by default ?
> It might break stuff, like things that link with code that assumes it
> is only 1024.

So if someone wants to increase it for an application he needs to be sure
that everything that it is linked with is compiled with a similar

Why can you safely increase the value in Squid then ?

> Shouldn't it be set to the real limit of the kernel ?
> Nah... the kernel limit is 1024^2 --- you don't want to use select
> anywhere near that.

Yes, but still, why 1024 ?

> (And let applications define their own limit if there is a need
> for one ?)
> Well, squid and friends do this anyhow.

No, squid takes the lowest of both (FD_SETSIZE and SQUID_MAXFD) in main.c.
And the Squid configure gets the FD_SETSIZE value from linux/posix_types.h

> Not only that, using a greatly increased value should be a run-time
> decision, lest you want your code to break on early 2.2.x kernels and
> before.

I'm still not convinced that something might break, since everybody
advices to increase __FD_SETSIZE before compiling Squid.

And if linux/posix_types.h defines the limit of open file descriptors of
the system, 1024 is (IMO) a wrong number. But then again, nobody bothered
to change it...

Thanks for your respons.

-- dag wieers,, --
«Onder voorbehoud van hetgeen niet uitdrukkelijk wordt erkend»

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:55    [W:0.045 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site