diff options
| author | Andi Kleen <ak@muc.de> | 2003-07-11 19:45:55 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-07-11 19:45:55 -0700 |
| commit | 209f0abbcc67c88f9af31f5dbd768c18bbf5ac09 (patch) | |
| tree | 530f6038a6ab2f38eed7d8976d349dfcd66c3996 /kernel/sysctl.c | |
| parent | ed08e6dfc28d810101c7665a72c73117888bc4a0 (diff) | |
[PATCH] Deprecate numerical sysctl
Deprecate the numerical sysctl name space. People can use /proc/sys
instead.
The numeric name space was never well maintained and especially
in distribution kernels is not very consistent (everybody has their
own extensions, conflicting with others). It's also a great
source of rejects when merging patches. The name-based /proc/sys
is a much better interface for this, which people should use instead.
Discussion of this on l-k found no advocate for it, so it seems to not
be very popular anyways.
This patch deprecates numerical name space accesses to make it possible
to remove them in the future. The only exception is kernel.version,
which is used by glibc (this one has to be maintained forever)
Diffstat (limited to 'kernel/sysctl.c')
| -rw-r--r-- | kernel/sysctl.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index d190b98f996a..6863399cb1dc 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -852,7 +852,16 @@ asmlinkage long sys_sysctl(struct __sysctl_args __user *args) if (copy_from_user(&tmp, args, sizeof(tmp))) return -EFAULT; - + + if (tmp.nlen != 2 || tmp.name[0] != CTL_KERN || + tmp.name[1] != KERN_VERSION) { + int i; + printk(KERN_INFO "%s: numerical sysctl ", current->comm); + for (i = 0; i < tmp.nlen; i++) + printk("%d ", tmp.name[i]); + printk("is obsolete.\n"); + } + lock_kernel(); error = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, tmp.oldlenp, tmp.newval, tmp.newlen); |
