From a482bb8a89f9d08d7a6171b9d23e80aef30048b8 Mon Sep 17 00:00:00 2001 From: Benjamin Lamowski Date: Thu, 26 Oct 2023 11:36:46 +0200 Subject: [PATCH] libc: silence sysconf(_SC_GETPW_R_SIZE_MAX) warning Currently, running ripgrep on Genode emits "Warning: sysconf(71) not implemented". Return -1 without setting errno, which is a valid return value according to getpwnam(3) and silence the warning. Fixes #5043 --- repos/libports/src/lib/libc/sysctl.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/repos/libports/src/lib/libc/sysctl.cc b/repos/libports/src/lib/libc/sysctl.cc index 8014b0d823..97df7acdbc 100644 --- a/repos/libports/src/lib/libc/sysctl.cc +++ b/repos/libports/src/lib/libc/sysctl.cc @@ -23,6 +23,7 @@ #include #include #include +#include /* libc-internal includes */ #include @@ -58,6 +59,8 @@ extern "C" long sysconf(int name) Affinity::Space space = _global_env->cpu().affinity_space(); return space.total() ? : 1; } + case _SC_GETPW_R_SIZE_MAX: + return -1; default: warning(__func__, "(", name, ") not implemented"); return Errno(EINVAL);