Why is procfs deprecated in favor of procstat?

John Baldwin jhb at freebsd.org
Wed Feb 23 12:45:43 UTC 2011

On Tuesday, February 22, 2011 2:10:57 pm Bob Friesenhahn wrote:
> On Tue, 22 Feb 2011, John Baldwin wrote:
> >
> > Actually, the replacement for procfs is not sysctl, but ptrace(2), and there
> I have been following this discussion with my jaw agape.  It seems 
> that the many men standing around this elephant are all perceiving 
> completely different things based on their own interests and 
> experiences.
> My own software is using procfs to efficiently determine the path to 
> the currently running executable.  I am sure that other software does 
> the same since Linux procfs (and probably OS X) supports the same 
> mechanism.  It is difficult to imagine how this would be done via 
> ptrace(2).

It would not be the first syscall to return a path to userland (see
__getcwd()).  Presumably the reason a ptrace(2) OP has not been added
for that is that it is that nothing that was ported from procfs to
ptrace(2) has needed it.

John Baldwin

More information about the freebsd-fs mailing list