]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/util: enable cgroup only on linux
authorKefu Chai <kchai@redhat.com>
Tue, 27 Apr 2021 02:11:53 +0000 (10:11 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 2 May 2021 00:16:12 +0000 (08:16 +0800)
commit7c0ed157d75df24994a2cad4f601a9e57daf7236
treee617ee45303e00d7faf19f3ed8c3e3a4e0242d85
parent08034454e1e81a933108caab3a764a2bc8c7aa3f
common/util: enable cgroup only on linux

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>
src/common/util.cc