cgroups, i.e. control groups, are a linux kernel feature. this is not
available on FreeBSD, Win32 or MacOS. furthermore, we are reading the
information of it by accessing files exposed using a tmpfs filesystem
mounted at /sys/fs/cgroup, which is not available on other systems.
in this change, instead of guarding it using `#ifndef _WIN32`, it is now
guraded using `defined(__linux__)`.
Signed-off-by: Kefu Chai <kchai@redhat.com>
int get_cgroup_memory_limit(uint64_t *limit)
{
-#ifndef _WIN32
+#if defined(__linux__)
// /sys/fs/cgroup/memory/memory.limit_in_bytes
// the magic value 9223372036854771712 or 0x7ffffffffffff000