From: John Levon <levon@movementarian.org>
To: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Cc: davem@redhat.com
Subject: [PATCH] /proc/sys/kernel/pointer_size
Date: Wed, 8 Jan 2003 19:59:34 +0000 [thread overview]
Message-ID: <20030108195934.GA35912@compsoc.man.ac.uk> (raw)
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},
next reply other threads:[~2003-01-08 19:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-08 19:59 John Levon [this message]
2003-01-08 20:28 ` [PATCH] /proc/sys/kernel/pointer_size 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030108195934.GA35912@compsoc.man.ac.uk \
--to=levon@movementarian.org \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.