This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: OPEN_MAX/FOPEN_MAX is dynamic?


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   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]