mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-11 00:36:20 +02:00
1e6a5d1ff6
Also, don't assume in LocalDerivationGoal that cgroups are mounted on /sys/fs/cgroup.
29 lines
585 B
C++
29 lines
585 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
|