3 ms·
I haven't poked through the code, but the linux man page isn't encouraging: "use the /proc/sys interface instead" [0] Compare that to the freebsd man page [1]
by woodman 12y ago
I haven't poked through the code, but the linux man page isn't encouraging: "use the /proc/sys interface instead" [0]
Compare that to the freebsd man page [1]
[0] http://man7.org/linux/man-pages/man2/sysctl.2.html#NOTES http://man7.org/linux/man-pages/man2/sysctl.2.html#NOTES
[1] https://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=3&manpath=FreeBSD+10.1-RELEASE https://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=3&m...
- caf 12y agoI think perhaps we might be talking at cross-purposes here. My point is that when you call write(2) under Linux on a file descriptor derived from opening a /proc/sys pseudo-file you are talking directly to the kernel code responsible for updating the sysctl variables in the same way as you are when you call sysctl(2) under FreeBSD. The /proc/sys files aren't real files - they're just a way of representing the sysctl variables in the existing file namespace.
- woodman 12y agoAh, when you said sysctl(2) I thought you were talking about the linux call - which is basically dead code. Yeah I don't really have a beef with the whole "everything is a file" design, I actually quite like it, but I really like how well freebsd has done sysctl - both the subroutine (3) and the command (8).