From 3f7c9ca039a167572457ea9a2b29609f27e3ac93 Mon Sep 17 00:00:00 2001 From: Andrei Tatar Date: Wed, 5 Jun 2024 20:37:00 +0200 Subject: [PATCH] lib/posix-sysinfo: Use posix-fdtab for SC_OPEN_MAX This change makes `sysinfo` take the size of the fdtab from Kconfig options of posix-fdtab instead of a macro defined by vfscore. This correctly reports the size of the file descriptor table, instead of the vfscore hardcoded default. Signed-off-by: Andrei Tatar Reviewed-by: Radu Nichita Approved-by: Razvan Deaconescu GitHub-Closes: #1455 --- lib/posix-sysinfo/sysinfo.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/posix-sysinfo/sysinfo.c b/lib/posix-sysinfo/sysinfo.c index 49804a3f9..9543cd6e9 100644 --- a/lib/posix-sysinfo/sysinfo.c +++ b/lib/posix-sysinfo/sysinfo.c @@ -46,11 +46,6 @@ #include #endif /* CONFIG_HAVE_PAGING */ -#if CONFIG_LIBVFSCORE -/* For FDTABLE_MAX_FILES. */ -#include -#endif - /** * The Unikraft `struct utsname` structure. * @@ -152,9 +147,9 @@ long sysconf(int name) } #endif /* CONFIG_HAVE_PAGING */ -#if CONFIG_LIBVFSCORE +#if CONFIG_LIBPOSIX_FDTAB if (name == _SC_OPEN_MAX) - return FDTABLE_MAX_FILES; + return CONFIG_LIBPOSIX_FDTAB_MAXFDS; #endif return 0; -- 2.39.5