Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Add Documentation/sysctl/ctl_unnumbered.txt

Poeple keep on adding new numbered sysctls, when they're supposed not to.

Add a documentation file which explain why new sysctls should use
CTL_UNNUMBERED. The next patch will sprinkle pointers to this throughout
sysctl.c.

Eric provided the text (thanks)

Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrew Morton and committed by
Linus Torvalds
97d8f83c 36cf3b5c

+22
+22
Documentation/sysctl/ctl_unnumbered.txt
··· 1 + 2 + Except for a few extremely rare exceptions user space applications do not use 3 + the binary sysctl interface. Instead everyone uses /proc/sys/... with 4 + readable ascii names. 5 + 6 + Recently the kernel has started supporting setting the binary sysctl value to 7 + CTL_UNNUMBERED so we no longer need to assign a binary sysctl path to allow 8 + sysctls to show up in /proc/sys. 9 + 10 + Assigning binary sysctl numbers is an endless source of conflicts in sysctl.h, 11 + breaking of the user space ABI (because of those conflicts), and maintenance 12 + problems. A complete pass through all of the sysctl users revealed multiple 13 + instances where the sysctl binary interface was broken and had gone undetected 14 + for years. 15 + 16 + So please do not add new binary sysctl numbers. They are unneeded and 17 + problematic. 18 + 19 + If you really need a new binary sysctl number please first merge your sysctl 20 + into the kernel and then as a separate patch allocate a binary sysctl number. 21 + 22 + (ebiederm@xmission.com, June 2007)