projects/linux·commit 61cf6931

[sysctl] Fix breakage on systems with older glibc

61cf6931 · Andi Kleen <[email protected]> · 2009-12-16 12:28:44 +01:00

As predicted during code review, the sysctl(2) changes made systems with
old glibc nearly unusable.  About every command gives a:

  warning: process `ls' used the deprecated sysctl system call with 1.4

warning in the log.

I see this on a SUSE 10.0 system with glibc 2.3.5.

Don't warn for this common case.

Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
61cf693159d6a968a7014e24905143f71ed8ddcf
Parents
288f02bb

Changes

1 files changed · +7 −0

FileStatusAddDelContent
kernel/sysctl_binary.cmodified+7−0View file

kernel/sysctl_binary.c

View file
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c
index b75dbf4..112533d 100644
--- a/kernel/sysctl_binary.c
+++ b/kernel/sysctl_binary.c
@@ -1399,6 +1399,13 @@ static void deprecated_sysctl_warning(const int *name, int nlen)
{
int i;
+ /*
+ * CTL_KERN/KERN_VERSION is used by older glibc and cannot
+ * ever go away.
+ */
+ if (name[0] == CTL_KERN && name[1] == KERN_VERSION)
+ return;
+
if (printk_ratelimit()) {
printk(KERN_INFO
"warning: process `%s' used the deprecated sysctl "