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

@ -12,7 +12,7 @@ COSMOPOLITAN_C_START_
#define SYSLIB_MAGIC ('s' | 'l' << 8 | 'i' << 16 | 'b' << 24)
#define SYSLIB_VERSION 9 /* sync with ape/ape-m1.c */
#define SYSLIB_VERSION 10 /* sync with ape/ape-m1.c */
/* if this number increases, then everyone on macos arm will need to
reinstall ape loader in order to run newer ape binaries so please
@ -82,6 +82,9 @@ struct Syslib {
char *(*__dlerror)(void);
/* v9 (2024-01-31) */
int (*__pthread_cpu_number_np)(size_t *);
long (*__sysctl)(int *, unsigned, void *, size_t *, void *, size_t);
long (*__sysctlbyname)(const char *, void *, size_t *, void *, size_t);
long (*__sysctlnametomib)(const char *, int *, size_t *);
};
extern struct Syslib *__syslib;