Re: OPEN_MAX & configure[.in]

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 30 Dec 1998 13:00:16 +0100

Chris Wedgwood wrote:

> For example, on my machine (linux 2.1.x + stuff) I can quite happily
> open 500K FDs but the configure script takes the value of OPEN_MAX
> (which is 256) as the `correct' value here.

Hard to tell. OPEN_MAX is defined as a limit on how many files a single
process may open, but when can this be trusted?

> In this instance, should this value not be defined -- or should we
> always try hard to see how many files we can open?

That to is not a good idea. Hard probing should be avoided if possible
as it may have a servere impact on the host. And on some OS:es number of
filedescriptors is effectively unlimited.

My bet is that rlimit should be trusted as much as possible, with
warnings if this is higher than OPEN_MAX or NR_OPEN. If select is used
then the lowest of rlimit and FD_SETSIZE should be used. If poll is used
then we do not need to care about FD_SETSIZE and conseqently FD_SETSIZE
should be ignored if poll is used.

/Henrik
Received on Tue Jul 29 2003 - 13:15:55 MDT

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