Kenny McCormack
2023-08-29 14:13:37 UTC
I have the following C program:
--- Cut Here ---
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
int main(void)
{
struct rlimit rlim;
printf("Result: %d\n",getrlimit(RLIMIT_NPROC, &rlim));
printf("cur = %lu, max = %lu\n",rlim.rlim_cur,rlim.rlim_max);
printf("RLIM_INFINITY = %ld\n",RLIM_INFINITY);
return 0;
}
--- Cut Here ---
When run on system A (Ubuntu - x64), the output is:
Result: 0
cur = 31411, max = 31411
RLIM_INFINITY = -1
What the heck is 31411???
When run on system B (Raspberry PiOS - ARM32), the output is:
Result: 0
cur = 6807, max = 6807
RLIM_INFINITY = -1
What the heck is 6807???
Neither of these results seem reasonable or tied to anything.
What is going on?
--- Cut Here ---
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
int main(void)
{
struct rlimit rlim;
printf("Result: %d\n",getrlimit(RLIMIT_NPROC, &rlim));
printf("cur = %lu, max = %lu\n",rlim.rlim_cur,rlim.rlim_max);
printf("RLIM_INFINITY = %ld\n",RLIM_INFINITY);
return 0;
}
--- Cut Here ---
When run on system A (Ubuntu - x64), the output is:
Result: 0
cur = 31411, max = 31411
RLIM_INFINITY = -1
What the heck is 31411???
When run on system B (Raspberry PiOS - ARM32), the output is:
Result: 0
cur = 6807, max = 6807
RLIM_INFINITY = -1
What the heck is 6807???
Neither of these results seem reasonable or tied to anything.
What is going on?
--
Kenny, I'll ask you to stop using quotes of mine as taglines.
- Rick C Hodgin -
Kenny, I'll ask you to stop using quotes of mine as taglines.
- Rick C Hodgin -