Hacker News new | ask | show | jobs
by codetrotter 2114 days ago
> Not sure it macOS has as much info in /proc?

macOS does not have procfs

1 comments

> macOS does not have procfs

https://en.wikipedia.org/wiki/Procfs

It also got dropped from OpenBSD:

> It was removed from OpenBSD in version 5.7, which was released in May 2015, because it "always suffered from race conditions and is now unused".[2]

The OpenBSD people don't say what you should replace it with, but backing up in the paragraph, the FreeBSD people do:

> As of February 2011, procfs is gradually becoming phased out in FreeBSD.[1]

Chasing that reference:

https://lists.freebsd.org/pipermail/freebsd-fs/2011-February...

> Why is procfs deprecated in favor of procstat?

[snip]

> 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):

> Simply put, procfs on FreeBSD has been neglected. There isn't a lot of attention being given to it, and the only modifications in recent months/years have been generally minor compared to the rest of the tree. You can review some of the commits yourself:

> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/fs/procfs/

> Others like yourself have asked what the state of procfs is, going back as far as 2005. Be sure to read the reply as well:

> http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/20...

Here's the FreeBSD procstat manpage:

https://www.freebsd.org/cgi/man.cgi?procstat

Aside from bitrot, is there a reason to prefer procstat over procfs?