| Rainer Weikusat 2007-01-26, 7:20 am |
| jt@toerring.de (Jens Thoms Toerring) writes:
> Connie <yeconnie@gmail.com> wrote:
>
> How do you determine the upper limit in C and Perl? There are soft
> and hard (per-process) limits and system-wide versus per-process
> limits - are you sure you're asking for the same thing in C and Perl?
> 1024 looks like it could be the value for the per-process limit while
> 10371 might be the system-wide limit.
It's weirder than that: On the system where I tried (Debian Stable/
Linux 2.6.20-rc3), the first script below prints 1024 after having
done a getrlimit-call and the second 131072, apparently pulling
the number out of some hat.
---------------
use POSIX;
printf "%s\n", POSIX::sysconf(POSIX::_SC_OPEN_MAX);
---------------
---------------
use POSIX qw(sysconf);
printf "%s\n", POSIX::sysconf(POSIX::_SC_OPEN_MAX);
---------------
|