1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 09:47:17 +00:00

Fixes on bsd for os/cpu-count.

This commit is contained in:
Calvin Rose 2022-05-28 12:21:44 -05:00
parent 8145f3b68d
commit 6ada2a458f

View File

@ -232,7 +232,7 @@ JANET_CORE_FN(os_cpu_count,
const int name[2] = {CTL_HW, HW_NCPUONLINE}; const int name[2] = {CTL_HW, HW_NCPUONLINE};
int result = 0; int result = 0;
size_t len = sizeof(int); size_t len = sizeof(int);
if (-1 == sysctl(name, 2, &result, &len, sizeof(result), NULL, 0)) { if (-1 == sysctl(name, 2, &result, &len, ,NULL, 0)) {
return dflt; return dflt;
} }
return janet_wrap_integer(result); return janet_wrap_integer(result);
@ -241,7 +241,7 @@ JANET_CORE_FN(os_cpu_count,
const int name[2] = {CTL_HW, HW_NCPU}; const int name[2] = {CTL_HW, HW_NCPU};
int result = 0; int result = 0;
size_t len = sizeof(int); size_t len = sizeof(int);
if (-1 == sysctl(name, 2, &result, &len, sizeof(result), NULL, 0)) { if (-1 == sysctl(name, 2, &result, &len, NULL, 0)) {
return dflt; return dflt;
} }
return janet_wrap_integer(result); return janet_wrap_integer(result);