Taken from http://kt.linuxcare.com/latest.epl on 2/3/2000, this is just one example of serious design problems with Linux, and serious questions about its present and future direction, considering the plans laid out by its creator. Apparently speed and efficiency aren't as important to Linus as having a pretty filesystemish interface. Hope you didn't want to do anything useful with your CPU in userspace...

/proc And sysctl()

2000/01/06 - 2000/01/12 (43 posts): /proc guidelines and sysctl

Benjamin Reed wrote a wireless ethernet driver that used /proc as its interface. But he was a little uncomfortable defining his own namespace under /proc, and asked if there were any conventions he should follow. He added, "And finally, what's up with sysctl? Are driver writers recommended to use that over extending /proc or is it deprecated? Again guide lines would be nice."

Linus replied with:

For the sysctl question, he added, "sysctl is deprecated. It's useful in one way only: it has some nice functions that can be used to add a block of /proc names. However, it has other downsides (allocating silly numbers etc - there should be no need for that, considering that the /proc namespace is alreayd a perfectly good namespace)."

Marcin Dalecki flamed Linus:

There was a bit of discussion, but Linus did not reply.

Alexander Viro replied to Linus' statement that sysctl was deprecated. He burst out with:

Linus replied that he'd accept a patch to turn sysctl into a proc-only thing. He added, "The current problem is that sysclt tries to be more than proc, and has its own name-space etc. Not worth it." Andi Kleen proposed, "The nice thing of giving up the sysctl numbers is that it would be possible to use some ELF section based scheme for declaring sysctl variables in nice wrapper macros. You could get a sysctl variable with a single declaration. This would make them a lot more easy. Would you accept a patch for that?" Linus replied, "Show me the patch, and I can consider it. It would certainly be nicer than what it is now (the include/linux/sysctl.h file is EVIL, and a perfect example of the kind of idiotic brokenness we used to have in /proc before it was cleaned up)."

Theodore Y. Ts'o also replied to Alexander, saying, "I actually like the original sysctl() design --- including the use of reserved numbers. After all, we have system calls, and we don't try to look up system calls when we executed them by name..... why is this OK for system calls, but not OK for sysctl()?" Linus replied:

Vi Powered Lynx Now! Powered by FreeBSD
Wed Jan 14 04:08:53 PST 2004   linux/stupidity.src
Updated: Sun Jul 28 2002 22:00.44   Viewed: never

Copyright © 1998-1999 by Nick Johnson. All rights reserved.