public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH: report NGROUPS_MAX via a sysctl (read-only)
@ 2004-02-20  2:39 Tim Hockin
  2004-02-20  5:30 ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Tim Hockin @ 2004-02-20  2:39 UTC (permalink / raw)
  To: Linux Kernel mailing list, akpm, torvalds

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

Attached is a simple patch to expose NGROUPS_MAX via sysctl.  Nothing fancy,
just a read-only variable.  glibc can use this to sysconf() the value
properly, so apps will stop relying on NGROUPS_MAX as a real constant.

Is this the right path?  Or should there be a sysconf-specific mechanism?
-- 
Tim Hockin
Sun Microsystems, Linux Software Engineering
thockin@sun.com
All opinions are my own, not Sun's

[-- Attachment #2: ngroups-sysctl-1.diff --]
[-- Type: text/plain, Size: 1277 bytes --]

===== include/linux/sysctl.h 1.64 vs edited =====
--- 1.64/include/linux/sysctl.h	Wed Feb 18 19:43:21 2004
+++ edited/include/linux/sysctl.h	Thu Feb 19 17:00:34 2004
@@ -129,6 +129,7 @@
 	KERN_HPPA_UNALIGNED=59,	/* int: hppa unaligned-trap enable */
 	KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */
 	KERN_PRINTK_RATELIMIT_BURST=61,	/* int: tune printk ratelimiting */
+	KERN_NGROUPS_MAX=62,	/* int: NGROUPS_MAX */
 };
 
 
===== kernel/sysctl.c 1.61 vs edited =====
--- 1.61/kernel/sysctl.c	Wed Feb 18 19:43:21 2004
+++ edited/kernel/sysctl.c	Thu Feb 19 17:05:47 2004
@@ -38,6 +38,7 @@
 #include <linux/security.h>
 #include <linux/initrd.h>
 #include <linux/times.h>
+#include <linux/limits.h>
 #include <asm/uaccess.h>
 
 #ifdef CONFIG_ROOT_NFS
@@ -68,6 +69,8 @@
 static int maxolduid = 65535;
 static int minolduid;
 
+static int ngroups_max = NGROUPS_MAX;
+
 #ifdef CONFIG_KMOD
 extern char modprobe_path[];
 #endif
@@ -591,6 +594,14 @@
 		.data		= &printk_ratelimit_burst,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
+	{
+		.ctl_name	= KERN_NGROUPS_MAX,
+		.procname	= "ngroups_max",
+		.data		= &ngroups_max,
+		.maxlen		= sizeof (int),
+		.mode		= 0444,
 		.proc_handler	= &proc_dointvec,
 	},
 	{ .ctl_name = 0 }

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-02-25  7:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-20  2:39 PATCH: report NGROUPS_MAX via a sysctl (read-only) Tim Hockin
2004-02-20  5:30 ` Andrew Morton
2004-02-20  6:35   ` Tim Hockin
2004-02-20  6:47     ` Andrew Morton
2004-02-20  7:10       ` Tim Hockin
2004-02-25  0:59         ` Glen Turner
2004-02-25  1:14           ` Tim Hockin
2004-02-25  7:32             ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox