libc: support 'RLIMIT_DATA' resource in 'getrlimit()'

Fixes #4049
This commit is contained in:
Christian Prochaska 2021-03-11 12:03:49 +01:00 committed by Norman Feske
parent 2f0898d2a9
commit 446df00d0d

View File

@ -37,7 +37,7 @@ extern "C" int __attribute__((weak)) getrlimit(int resource, struct rlimit *rlim
/* /*
* Maximal size of address space * Maximal size of address space
*/ */
if (resource == RLIMIT_AS) { if ((resource == RLIMIT_AS) || (resource == RLIMIT_DATA)) {
rlim->rlim_cur = LONG_MAX; rlim->rlim_cur = LONG_MAX;
rlim->rlim_max = LONG_MAX; rlim->rlim_max = LONG_MAX;
return 0; return 0;
@ -52,6 +52,11 @@ extern "C" int __attribute__((weak)) getrlimit(int resource, struct rlimit *rlim
return 0; return 0;
} }
Genode::warning(__func__, " called for unsupported resource ", resource, ", returning 0");
rlim->rlim_cur = 0;
rlim->rlim_max = 0;
return 0; return 0;
} }