From 112b5b91647c3dea45cc1c9bc364df526c8012f1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 26 Jan 2022 19:05:15 +0100 Subject: Merging upstream version 1.33.0. Signed-off-by: Daniel Baumann --- libnetdata/os.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'libnetdata/os.c') diff --git a/libnetdata/os.c b/libnetdata/os.c index 4271a917c..196288a6a 100644 --- a/libnetdata/os.c +++ b/libnetdata/os.c @@ -123,7 +123,9 @@ void get_system_HZ(void) { // ===================================================================================================================== // FreeBSD -#if (TARGET_OS == OS_FREEBSD) +#if __FreeBSD__ + +const char *os_type = "freebsd"; int getsysctl_by_name(const char *name, void *ptr, size_t len) { size_t nlen = len; @@ -198,7 +200,9 @@ int getsysctl_mib(const char *name, int *mib, size_t len) { // ===================================================================================================================== // MacOS -#if (TARGET_OS == OS_MACOS) +#if __APPLE__ + +const char *os_type = "macos"; int getsysctl_by_name(const char *name, void *ptr, size_t len) { size_t nlen = len; @@ -214,4 +218,13 @@ int getsysctl_by_name(const char *name, void *ptr, size_t len) { return 0; } -#endif // (TARGET_OS == OS_MACOS) +#endif + +// ===================================================================================================================== +// Linux + +#if __linux__ + +const char *os_type = "linux"; + +#endif -- cgit v1.2.3