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
This commit is contained in:
Benjamin Lamowski 2023-10-26 11:36:46 +02:00 committed by Christian Helmuth
parent 6eaf333f10
commit a482bb8a89

View File

@ -23,6 +23,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <pwd.h>
/* libc-internal includes */
#include <internal/plugin.h>
@ -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);