summaryrefslogtreecommitdiffstats
path: root/src/macos_sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--collectors/macos.plugin/macos_sysctl.c (renamed from src/macos_sysctl.c)20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/macos_sysctl.c b/collectors/macos.plugin/macos_sysctl.c
index cb6fa8af9..6b443c04a 100644
--- a/src/macos_sysctl.c
+++ b/collectors/macos.plugin/macos_sysctl.c
@@ -1,6 +1,8 @@
-#include "common.h"
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "plugin_macos.h"
+
#include <Availability.h>
-#include <sys/sysctl.h>
// NEEDED BY: do_bandwidth
#include <net/route.h>
// NEEDED BY do_tcp...
@@ -1488,17 +1490,3 @@ int do_macos_sysctl(int update_every, usec_t dt) {
return 0;
}
-int getsysctl_by_name(const char *name, void *ptr, size_t len)
-{
- size_t nlen = len;
-
- if (unlikely(sysctlbyname(name, ptr, &nlen, NULL, 0) == -1)) {
- error("MACOS: sysctl(%s...) failed: %s", name, strerror(errno));
- return 1;
- }
- if (unlikely(nlen != len)) {
- error("MACOS: sysctl(%s...) expected %lu, got %lu", name, (unsigned long)len, (unsigned long)nlen);
- return 1;
- }
- return 0;
-}