From fb980d64744e076cfcb3e93d8f5e46b3ff9543bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Sat, 3 Jul 2021 00:31:55 -0300 Subject: [PATCH] use NGROUPS_MAX instead of hardcoded value where possible if someone using musl finds it necessary to patch musl to use 65536 as NGROUPS_MAX, as defined by kernels >= 2.6.4, they can patch it in one place, include/limits.h, instead of having to find all the places where it's hardcoded --- include/sys/param.h | 2 +- src/conf/sysconf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sys/param.h b/include/sys/param.h index ce6b8019..f4780588 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -6,7 +6,7 @@ #define MAXNAMLEN 255 #define MAXPATHLEN 4096 #define NBBY 8 -#define NGROUPS 32 +#define NGROUPS NGROUPS_MAX #define CANBSIZ 255 #define NOFILE 256 #define NCARGS 131072 diff --git a/src/conf/sysconf.c b/src/conf/sysconf.c index 3baaed32..1a5d3860 100644 --- a/src/conf/sysconf.c +++ b/src/conf/sysconf.c @@ -28,7 +28,7 @@ long sysconf(int name) [_SC_ARG_MAX] = JT_ARG_MAX, [_SC_CHILD_MAX] = RLIM(NPROC), [_SC_CLK_TCK] = 100, - [_SC_NGROUPS_MAX] = 32, + [_SC_NGROUPS_MAX] = NGROUPS_MAX, [_SC_OPEN_MAX] = RLIM(NOFILE), [_SC_STREAM_MAX] = -1, [_SC_TZNAME_MAX] = TZNAME_MAX, -- 2.32.0