sysctl filesystem ?

Robert N. M. Watson rwatson at freebsd.org
Mon Jul 2 08:28:42 UTC 2012


On 26 Jun 2012, at 15:42, mdf at FreeBSD.org wrote:

> While I understand the problems you allude to, the sysctl(8) binary
> can protect itself from them.  IMO the biggest problem with sysctls
> not being files is that it makes no sense from the core UNIX
> philosophy that everything is a file.  Sockets and pipes and character
> devices and even unseekable things like stdout are files; why aren't
> these other objects that allow read, write, and have their own
> namespace?


I think I agree with what you're saying, subject to one modification: rather than saying "files", say "file descriptors", which are not quite the same but are, I think, what you mean. This doesn't mean you end up with a special file system mounted on /foo -- we don't do that for sockets or pipes --- but rather, we end up with using a similar object-oriented interface. And hence, BTW, our recent experimental addition of process descriptors to the API in support of Capsicum. However, I wonder how well that applies to sysctls, which unlike pipes/sockets, don't have an event model, etc...

Robert


More information about the freebsd-current mailing list