Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Oct 2020 11:57:56 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r366966 - head/sys/compat/linprocfs
Message-ID:  <202010231157.09NBvupX032873@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Fri Oct 23 11:57:55 2020
New Revision: 366966
URL: https://svnweb.freebsd.org/changeset/base/366966

Log:
  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

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- head/sys/compat/linprocfs/linprocfs.c	Fri Oct 23 10:48:14 2020	(r366965)
+++ head/sys/compat/linprocfs/linprocfs.c	Fri Oct 23 11:57:55 2020	(r366966)
@@ -1453,6 +1453,19 @@ linprocfs_domsgmnb(PFS_FILL_ARGS)
 }
 
 /*
+ * 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
  */
 static int
@@ -1921,6 +1934,8 @@ linprocfs_init(PFS_INIT_ARGS)
 	pfs_create_file(dir, "msgmni", &linprocfs_domsgmni,
 	    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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010231157.09NBvupX032873>