Side note: the following code runs fine on my box:
<code> #include <sys/resource.h> #include <stdio.h>
int main(int argc, char **argv) { struct rlimit rl; int result;
result = getrlimit(RLIMIT_NOFILE, &rl); printf("%d -> %d %d\n", result, (int) rl.rlim_cur, (int) rl.rlim_max); return 0; } </code>
Running it as user, the result is
albrecht@antares:~/ubuntu$ ./test_lim 0 -> 1024 4096
Strange!!
Side note: the following code runs fine on my box:
<code>
#include <sys/resource.h>
#include <stdio.h>
int main(int argc, char **argv)
{
struct rlimit rl;
int result;
result = getrlimit( RLIMIT_ NOFILE, &rl);
printf("%d -> %d %d\n", result, (int) rl.rlim_cur, (int) rl.rlim_max);
return 0;
}
</code>
Running it as user, the result is
albrecht@ antares: ~/ubuntu$ ./test_lim
0 -> 1024 4096
Strange!!