in reply to ulimit output?
Rather than relying on the shell, if you have BSD::Resouce installed, you could:
or if you're feeling really adventurous, with Inline::C#!/usr/bin/perl use strict; use warnings; use BSD::Resource; my $max = getrlimit( RLIMIT_NOFILE ); print "$max\n";
(that needs more error checking).#!/usr/bin/perl use Inline C; use strict; my $max = get_max_files(); print $max, "\n"; __END__ __C__ #include <sys/resource.h> int get_max_files() { struct rlimit rl; if (getrlimit( RLIMIT_NOFILE, &rl) == 0) { return rl.rlim_cur; } else { return -1; } }
|
|---|