aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/platform/linux.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/platform/linux.cc')
-rw-r--r--src/libstore/platform/linux.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstore/platform/linux.cc b/src/libstore/platform/linux.cc
index a34608894..6b94c01cc 100644
--- a/src/libstore/platform/linux.cc
+++ b/src/libstore/platform/linux.cc
@@ -1,3 +1,4 @@
+#include "cgroup.hh"
#include "gc-store.hh"
#include "signals.hh"
#include "platform/linux.hh"
@@ -114,4 +115,17 @@ void LinuxLocalStore::findPlatformRoots(UncheckedRoots & unchecked)
readFileRoots("/proc/sys/kernel/fbsplash", unchecked);
readFileRoots("/proc/sys/kernel/poweroff_cmd", unchecked);
}
+
+void LinuxLocalDerivationGoal::killSandbox(bool getStats)
+{
+ if (cgroup) {
+ auto stats = destroyCgroup(*cgroup);
+ if (getStats) {
+ buildResult.cpuUser = stats.cpuUser;
+ buildResult.cpuSystem = stats.cpuSystem;
+ }
+ } else {
+ LocalDerivationGoal::killSandbox(getStats);
+ }
+}
}