From 2e4959bab803b989d5adbc18b1d26ead0653e7fc Mon Sep 17 00:00:00 2001 From: Craig Small Date: Sun, 17 Jul 2016 09:06:24 +1000 Subject: [PATCH] library: dont use vm_min_free on non-Linux systems For a specific slice of kernel versions we can get a better estimate of the available memory before the "real" available figure appears around kernel 3.2 However, that middle method requires a /proc/sys/vm directory. FreeBSD 9.x used to emulate a < 2.6.27 kernel procfs meaning it never tried the middle method. FreeBSD 10.x emulates something more modern, but without the available figure and without a /proc/sys/vm, so the library falls into a hole. Hurd may to one day have this bug so we'll exclude him as well as its triggered by whatever number appears in /proc/sys/kernel/osrelease References: commit 3f3b1a59ada85d21f34530cfb1dc1c0afd70e6dc https://bugs.debian.org/831396 --- NEWS | 1 + proc/sysinfo.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/NEWS b/NEWS index dd69166e..beddfca1 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ procps-ng-NEXT ---------------- * watch: define HOST_NAME_MAX where not defined Debian #830734 + * library: dont use vm_min_free on non Linux Debian #831396 procps-ng-3.3.12 ---------------- diff --git a/proc/sysinfo.c b/proc/sysinfo.c index 1435de1a..be43bc30 100644 --- a/proc/sysinfo.c +++ b/proc/sysinfo.c @@ -719,6 +719,7 @@ nextline: /* zero? might need fallback for 2.6.27 <= kernel