Add sysctlbyname() for MacOS

This commit is contained in:
Justine Tunney 2024-05-02 23:21:43 -07:00
parent 5c6877b02b
commit 181cd4cbe8
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
21 changed files with 193 additions and 35 deletions

View file

@ -23,7 +23,7 @@ long __get_sysctl(int x, int y) {
int value;
int mib[2] = {x, y};
size_t len = sizeof(value);
if (sys_sysctl(mib, 2, &value, &len, 0, 0) != -1) {
if (sysctl(mib, 2, &value, &len, 0, 0) != -1) {
return value;
} else {
return -1;