Lurker News
Back to discussion

Comment by kajecounterhack

kajecounterhack1 reply#
Ah, thanks for the correction. I had no idea it wasn't using procfs anymore, or that darwin was using something very different. TIL :)
masklinn#
> I had no idea it wasn't using procfs anymore

It still uses procfs for Linux (since that's there by default), but not for the other ports. Consider Platform_getLoadAverage for instance:
* linux uses /proc/loadavg[0]
* freebsd and openbsd use sysctl({CTL_VM, VM_LOADAVG})[1][2]
* OSX uses getloadavg(3)[3]
[0] https://github.com/hishamhm/htop/blob/master/linux/Platform....
[1] https://github.com/hishamhm/htop/blob/master/freebsd/Platfor...
[2] https://github.com/hishamhm/htop/blob/master/openbsd/Platfor...
[3] https://github.com/hishamhm/htop/blob/master/darwin/Platform...