X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Fcommon.c;h=88fcf85bc2a981ec35270db4f7281118d46052fc;hb=2471055410a7386a8e503b9a72a13c4117c8690b;hp=e46397c624be004daa578e0539563b90bd5985e8;hpb=1d0c1b2c14712b9da7270450b275726322f5f680;p=netdata.git diff --git a/src/common.c b/src/common.c index e46397c6..88fcf85b 100644 --- a/src/common.c +++ b/src/common.c @@ -914,6 +914,9 @@ char *trim(char *s) { } void *mymmap(const char *filename, size_t size, int flags, int ksm) { +#ifndef MADV_MERGEABLE + (void)ksm; +#endif static int log_madvise_1 = 1; #ifdef MADV_MERGEABLE static int log_madvise_2 = 1, log_madvise_3 = 1; @@ -1104,7 +1107,7 @@ long get_system_cpus(void) { #ifdef __APPLE__ int32_t tmp_processors; - if (unlikely(GETSYSCTL("hw.logicalcpu", tmp_processors))) { + if (unlikely(GETSYSCTL_BY_NAME("hw.logicalcpu", tmp_processors))) { error("Assuming system has %d processors.", processors); } else { processors = tmp_processors; @@ -1114,7 +1117,7 @@ long get_system_cpus(void) { #elif __FreeBSD__ int32_t tmp_processors; - if (unlikely(GETSYSCTL("hw.ncpu", tmp_processors))) { + if (unlikely(GETSYSCTL_BY_NAME("hw.ncpu", tmp_processors))) { error("Assuming system has %d processors.", processors); } else { processors = tmp_processors; @@ -1166,7 +1169,7 @@ pid_t get_system_pid_max(void) { #elif __FreeBSD__ int32_t tmp_pid_max; - if (unlikely(GETSYSCTL("kern.pid_max", tmp_pid_max))) { + if (unlikely(GETSYSCTL_BY_NAME("kern.pid_max", tmp_pid_max))) { pid_max = 99999; error("Assuming system's maximum pid is %d.", pid_max); } else {