Add /proc/sys/kernel/ngroups_max to linprocfs(4). The id(1) command

seems to use it - it works fine without it, but still.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26898
This commit is contained in:
Edward Tomasz Napierala 2020-10-23 11:57:55 +00:00
parent c77b04884c
commit 7135ca98d2

View File

@ -1452,6 +1452,19 @@ linprocfs_domsgmnb(PFS_FILL_ARGS)
return (0);
}
/*
* Filler function for proc/sys/kernel/ngroups_max
*
* Note that in Linux it defaults to 65536, not 1023.
*/
static int
linprocfs_dongroups_max(PFS_FILL_ARGS)
{
sbuf_printf(sb, "%d\n", ngroups_max);
return (0);
}
/*
* Filler function for proc/sys/kernel/pid_max
*/
@ -1922,6 +1935,8 @@ linprocfs_init(PFS_INIT_ARGS)
NULL, NULL, NULL, PFS_RD);
pfs_create_file(dir, "msgmnb", &linprocfs_domsgmnb,
NULL, NULL, NULL, PFS_RD);
pfs_create_file(dir, "ngroups_max", &linprocfs_dongroups_max,
NULL, NULL, NULL, PFS_RD);
pfs_create_file(dir, "pid_max", &linprocfs_dopid_max,
NULL, NULL, NULL, PFS_RD);
pfs_create_file(dir, "sem", &linprocfs_dosem,