diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-26 18:05:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-26 18:05:10 +0000 |
commit | 34a0b66bc2d48223748ed1cf5bc1b305c396bd74 (patch) | |
tree | fbd36be86cc6bc4288fe627f2b5beada569848bb /libnetdata/os.h | |
parent | Adding upstream version 1.32.1. (diff) | |
download | netdata-34a0b66bc2d48223748ed1cf5bc1b305c396bd74.tar.xz netdata-34a0b66bc2d48223748ed1cf5bc1b305c396bd74.zip |
Adding upstream version 1.33.0.upstream/1.33.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnetdata/os.h')
-rw-r--r-- | libnetdata/os.h | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/libnetdata/os.h b/libnetdata/os.h index 2494174b..7872f82b 100644 --- a/libnetdata/os.h +++ b/libnetdata/os.h @@ -6,15 +6,9 @@ #include "libnetdata.h" // ===================================================================================================================== -// Linux - -#if (TARGET_OS == OS_LINUX) - - -// ===================================================================================================================== // FreeBSD -#elif (TARGET_OS == OS_FREEBSD) +#if __FreeBSD__ #include <sys/sysctl.h> @@ -35,28 +29,24 @@ extern int getsysctl_simple(const char *name, int *mib, size_t miblen, void *ptr extern int getsysctl(const char *name, int *mib, size_t miblen, void *ptr, size_t *len); +#endif // ===================================================================================================================== // MacOS -#elif (TARGET_OS == OS_MACOS) +#if __APPLE__ #include <sys/sysctl.h> #define GETSYSCTL_BY_NAME(name, var) getsysctl_by_name(name, &(var), sizeof(var)) extern int getsysctl_by_name(const char *name, void *ptr, size_t len); - -// ===================================================================================================================== -// unknown O/S - -#else -#error unsupported operating system #endif - // ===================================================================================================================== -// common for all O/S +// common defs for Apple/FreeBSD/Linux + +extern const char *os_type; extern int processors; extern long get_system_cpus(void); |