From 446df00d0d8a36e191d520d9d386253308d10c3c Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Thu, 11 Mar 2021 12:03:49 +0100 Subject: [PATCH] libc: support 'RLIMIT_DATA' resource in 'getrlimit()' Fixes #4049 --- repos/libports/src/lib/libc/rlimit.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repos/libports/src/lib/libc/rlimit.cc b/repos/libports/src/lib/libc/rlimit.cc index 4ce8aecbd2..5e8172cb00 100644 --- a/repos/libports/src/lib/libc/rlimit.cc +++ b/repos/libports/src/lib/libc/rlimit.cc @@ -37,7 +37,7 @@ extern "C" int __attribute__((weak)) getrlimit(int resource, struct rlimit *rlim /* * Maximal size of address space */ - if (resource == RLIMIT_AS) { + if ((resource == RLIMIT_AS) || (resource == RLIMIT_DATA)) { rlim->rlim_cur = LONG_MAX; rlim->rlim_max = LONG_MAX; return 0; @@ -52,6 +52,11 @@ extern "C" int __attribute__((weak)) getrlimit(int resource, struct rlimit *rlim return 0; } + Genode::warning(__func__, " called for unsupported resource ", resource, ", returning 0"); + + rlim->rlim_cur = 0; + rlim->rlim_max = 0; + return 0; }