summaryrefslogtreecommitdiffstats
path: root/libnetdata/os.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-26 18:05:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-26 18:05:10 +0000
commit34a0b66bc2d48223748ed1cf5bc1b305c396bd74 (patch)
treefbd36be86cc6bc4288fe627f2b5beada569848bb /libnetdata/os.c
parentAdding upstream version 1.32.1. (diff)
downloadnetdata-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.c')
-rw-r--r--libnetdata/os.c19
1 files changed, 16 insertions, 3 deletions
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