sysctl and /sysfs

Ihor Antonov ihor at antonovs.family
Sun Jan 19 04:27:44 UTC 2020


Hi everyone,

I am coming to FreeBSD from Linux and I have questions about system structure.

I noticed that FreeBSD makes heavy use of `sysctl` to read and write kernel 
parameters. Linux has /proc and /sys filesystems that represent various kernel 
data structures, some of which could be writable.

In the spirit of Unix philosophy "everything is a file" I was wondering if 
FreeBSD provides a view into kernel's parameters similar to sysfs on linux?
It feels a bit strange that instead of naturally exposing hierarchical kernel 
data structures in a form of filesystem one has to use sysctl and text values 
in a "parend.child.subchild" pattern. So the question is why?

It is possible that I am missing something or maybe FreeBSD has a different 
view on this problem - I would love to understand! 

Thanks
-- 
Ihor Antonov
https://useplaintext.email
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20200118/36b9a1b6/attachment.sig>


More information about the freebsd-questions mailing list