Why is procfs deprecated in favor of procstat?

John Baldwin jhb at freebsd.org
Tue Feb 22 16:19:57 UTC 2011

On Tuesday, February 22, 2011 4:52:11 am Jeremy Chadwick wrote:
> On Tue, Feb 22, 2011 at 12:45:36AM -0800, Kelly Dean wrote:
> > [ snipping stuff that I have no real response to :-) ]
> >
> > Jeremy, when you said procfs should be removed, did you mean just for
> > the same reasons Oliver said, or did you have other reasons?
> The security issues are long-standing and there have been many over the
> years, but the real reason is something that's less evident (or at least
> less directly apparent):

Actually, the replacement for procfs is not sysctl, but ptrace(2), and there 
has been a long-running process in place to migrate tools such as truss, etc. 
from using procfs to use ptrace(2) instead and to add new features to 
ptrace(2) when there were things it did not support that procfs did.  One 
could argue that some of the more recent things like the sysctl's for procstat 
-v or procstat -k should have been implemented as new ptrace OPs rather than 
sysctls (and I'd probably agree with you).

John Baldwin

More information about the freebsd-fs mailing list