3 ms·
Ah, thanks for the correction. I had no idea it wasn't using procfs anymore, or that darwin was using something very different. TIL :)
by kajecounterhack 11y ago
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 11y ago> 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.c#L143 https://github.com/hishamhm/htop/blob/master/linux/Platform.... [1] https://github.com/hishamhm/htop/blob/master/freebsd/Platform.c#L123 https://github.com/hishamhm/htop/blob/master/freebsd/Platfor... [2] https://github.com/hishamhm/htop/blob/master/openbsd/Platform.c#L181 https://github.com/hishamhm/htop/blob/master/openbsd/Platfor... [3] https://github.com/hishamhm/htop/blob/master/darwin/Platform.c#L144 https://github.com/hishamhm/htop/blob/master/darwin/Platform...