diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:19:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:20:17 +0000 |
commit | a64a253794ac64cb40befee54db53bde17dd0d49 (patch) | |
tree | c1024acc5f6e508814b944d99f112259bb28b1be /collectors/macos.plugin/macos_sysctl.c | |
parent | New upstream version 1.10.0+dfsg (diff) | |
download | netdata-upstream/1.11.0+dfsg.tar.xz netdata-upstream/1.11.0+dfsg.zip |
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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; -} |