forked from lix-project/lix
abd5e7dec0
Picking up from #8111. Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
32 lines
590 B
C++
32 lines
590 B
C++
#pragma once
|
|
|
|
#if __linux__
|
|
|
|
#include <chrono>
|
|
#include <optional>
|
|
|
|
#include "types.hh"
|
|
|
|
namespace nix {
|
|
|
|
std::optional<Path> getCgroupFS();
|
|
|
|
std::map<std::string, std::string> getCgroups(const Path & cgroupFile);
|
|
|
|
struct CgroupStats
|
|
{
|
|
std::optional<std::chrono::microseconds> cpuUser, cpuSystem;
|
|
};
|
|
|
|
/**
|
|
* Destroy the cgroup denoted by 'path'. The postcondition is that
|
|
* 'path' does not exist, and thus any processes in the cgroup have
|
|
* been killed. Also return statistics from the cgroup just before
|
|
* destruction.
|
|
*/
|
|
CgroupStats destroyCgroup(const Path & cgroup);
|
|
|
|
}
|
|
|
|
#endif
|