aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
authorAlex Wied <centromere@users.noreply.github.com>2022-07-19 02:09:46 -0400
committerAlex Wied <centromere@users.noreply.github.com>2022-07-19 16:25:53 -0400
commit722de8ddcc875c7e8e9a228f9d88454bae31fd40 (patch)
tree6ec425a1ab1a10c41c7a74ad0aa85c775b4dfe44 /src/libutil/util.hh
parent1af5d798a4d10a07e995d420a759f2fe752b583a (diff)
libstore/globals.cc: Move cgroup detection to libutil
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r--src/libutil/util.hh3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index d3ed15b0b..29227ecc6 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -182,6 +182,9 @@ std::string drainFD(int fd, bool block = true, const size_t reserveSize=0);
void drainFD(int fd, Sink & sink, bool block = true);
+/* If cgroups are active, attempt to calculate the number of CPUs available.
+ If cgroups are unavailable or if cpu.max is set to "max", return 0. */
+unsigned int getMaxCPU();
/* Automatic cleanup of resources. */