Skip to content

Commit 61cf693

Browse files
Andi Kleentorvalds
authored andcommitted
[sysctl] Fix breakage on systems with older glibc
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 <ak@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 288f02b commit 61cf693

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/sysctl_binary.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,13 @@ static void deprecated_sysctl_warning(const int *name, int nlen)
13991399
{
14001400
int i;
14011401

1402+
/*
1403+
* CTL_KERN/KERN_VERSION is used by older glibc and cannot
1404+
* ever go away.
1405+
*/
1406+
if (name[0] == CTL_KERN && name[1] == KERN_VERSION)
1407+
return;
1408+
14021409
if (printk_ratelimit()) {
14031410
printk(KERN_INFO
14041411
"warning: process `%s' used the deprecated sysctl "

0 commit comments

Comments
 (0)