01-25-07 12:19 PM
Casper H.S. Dik <Casper.Dik@Sun.COM> writes:
> Rainer Weikusat <rainer.weikusat@sncag.com> writes:
>
>
>
> While simple, it may not do what you want and it may do it slowly.
>
> - If the descriptor limit is dropped, sysconf()
> may return a number lower than the highest open descriptor
Using setrlimit that way is not portable behaviour for
UNIX(*)-systems, cf SUS, so, your statement should probably read that
'on certain versions of SunOS, namely ..., setrlimit could have been
used to limit the highest file descriptor available to the application
to one numerically smaller than the highest open file descriptor'.
> - sysconf() may return a ridicously large number; e.g.,
> Solaris allows basically "MAXINT" file descriptors for
> a process. A few billion calls to close does cost quite a bit
> of time.
That's an inherent problem of this approach.
[ Post a follow-up to this message ]
|