public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] /proc/sys/kernel/pointer_size
@ 2003-01-08 19:59 John Levon
  2003-01-08 20:28 ` Linus Torvalds
  0 siblings, 1 reply; 16+ messages in thread
From: John Levon @ 2003-01-08 19:59 UTC (permalink / raw)
  To: torvalds, linux-kernel; +Cc: davem


OProfile needs to know the pointer size being used for the kernel,
on platforms with 32-bit userspace and 64-bit kernel. This patch adds
a simple ro sysctl that exports this information as suggested by davem

thanks,
john


diff -X dontdiff -Naur linux-linus/include/linux/sysctl.h linux/include/linux/sysctl.h
--- linux-linus/include/linux/sysctl.h	2003-01-03 02:59:14.000000000 +0000
+++ linux/include/linux/sysctl.h	2003-01-03 03:14:44.000000000 +0000
@@ -129,6 +129,7 @@
 	KERN_CADPID=54,		/* int: PID of the process to notify on CAD */
 	KERN_PIDMAX=55,		/* int: PID # limit */
   	KERN_CORE_PATTERN=56,	/* string: pattern for core-file names */
+	KERN_POINTER_SIZE=57,	/* size_t: sizeof(void *) */
 };
 
 
diff -X dontdiff -Naur linux-linus/kernel/sysctl.c linux/kernel/sysctl.c
--- linux-linus/kernel/sysctl.c	2002-12-16 04:09:26.000000000 +0000
+++ linux/kernel/sysctl.c	2002-12-16 04:13:58.000000000 +0000
@@ -56,6 +56,9 @@
 extern int pid_max;
 extern int sysctl_lower_zone_protection;
 
+/* Needed when user-space is 32-bit with 64-bit kernel */
+static int pointer_size = (int)sizeof(void *);
+ 
 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
 static int maxolduid = 65535;
 static int minolduid;
@@ -180,6 +183,8 @@
 	 0644, NULL, &proc_dointvec},
 	{KERN_CAP_BSET, "cap-bound", &cap_bset, sizeof(kernel_cap_t),
 	 0600, NULL, &proc_dointvec_bset},
+	{KERN_POINTER_SIZE, "pointer_size", &pointer_size, sizeof(int),
+	 0444, NULL, &proc_dointvec},
 #ifdef CONFIG_BLK_DEV_INITRD
 	{KERN_REALROOTDEV, "real-root-dev", &real_root_dev, sizeof(int),
 	 0644, NULL, &proc_dointvec},

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

end of thread, other threads:[~2003-01-11 11:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-08 19:59 [PATCH] /proc/sys/kernel/pointer_size John Levon
2003-01-08 20:28 ` Linus Torvalds
2003-01-08 20:52   ` John Levon
2003-01-08 21:03     ` Linus Torvalds
2003-01-08 22:37       ` David S. Miller
2003-01-08 22:40       ` John Levon
2003-01-11  9:18       ` Kai Henningsen
2003-01-08 22:34   ` David S. Miller
2003-01-08 23:04     ` Linus Torvalds
2003-01-08 23:03       ` David S. Miller
2003-01-09  0:02         ` Linus Torvalds
2003-01-09  0:03           ` David S. Miller
2003-01-09  4:00             ` Daniel Jacobowitz
2003-01-09  4:31               ` David S. Miller
2003-01-09  5:23               ` William Lee Irwin III
2003-01-09 23:09       ` Bill Davidsen

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