summaryrefslogtreecommitdiffstats
path: root/libnetdata/os.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-26 18:05:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-26 18:05:42 +0000
commit112b5b91647c3dea45cc1c9bc364df526c8012f1 (patch)
tree450af925135ec664c4310a1eb28b69481094ee2a /libnetdata/os.h
parentReleasing debian version 1.32.1-2. (diff)
downloadnetdata-112b5b91647c3dea45cc1c9bc364df526c8012f1.tar.xz
netdata-112b5b91647c3dea45cc1c9bc364df526c8012f1.zip
Merging upstream version 1.33.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnetdata/os.h')
-rw-r--r--libnetdata/os.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/libnetdata/os.h b/libnetdata/os.h
index 2494174bc..7872f82b9 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);