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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to