Back to discussionComment by kajecounterhack[-]kajecounterhack10 years ago1 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 :)masklinn10 years ago#> I had no idea it wasn't using procfs anymoreIt 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...
kajecounterhack10 years ago1 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 :)
masklinn10 years ago#> I had no idea it wasn't using procfs anymoreIt 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...
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...