Re: OPEN_MAX/FOPEN_MAX is dynamic?

Ulrich Drepper (drepper@cygnus.com)
19 Oct 1998 20:53:16 -0700


Roland McGrath <roland@frob.com> writes:

> Not true.

It is true. __FD_SETSIZE is used in the type definition and therefore
must be a compile time constant. This is completely independent of
what you can pass to select.

> If you dynamically allocate a bit vector big enough for the maxfd you are
> passing to select, you are fine. This is the way select was originally
> intended to be used, since 4.2 BSD.

You can of course do this, I never said something contrary. But fact
is that this means that you at some point violate against the type
definition and when we one day have the bound checking functionality
in gcc if will barf.

The only "clean" solution is to let the user select the __FD_SETSIZE
value.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/