mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Add sysctlbyname() for MacOS
This commit is contained in:
parent
5c6877b02b
commit
181cd4cbe8
21 changed files with 193 additions and 35 deletions
|
@ -64,7 +64,7 @@ int getloadavg(double *a, int n) {
|
|||
struct loadavg loadinfo;
|
||||
int mib[2] = {CTL_VM, VM_LOADAVG};
|
||||
size = sizeof(loadinfo);
|
||||
if ((rc = sys_sysctl(mib, 2, &loadinfo, &size, 0, 0)) != -1) {
|
||||
if ((rc = sysctl(mib, 2, &loadinfo, &size, 0, 0)) != -1) {
|
||||
for (i = 0; i < n; i++) {
|
||||
a[i] = (double)loadinfo.ldavg[i] / loadinfo.fscale;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue