![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include <filesystem>#include <optional>#include <chrono>#include <sys/resource.h>#include "nix/util/types.hh"Go to the source code of this file.
Functions | |
| std::chrono::microseconds | nix::getCpuUserTime () |
| unsigned int | nix::getMaxCPU () |
| void | nix::ensureStackSizeAtLeast (size_t stackSize) |
| void | nix::restoreProcessContext (bool restoreMounts) |
| std::optional< std::filesystem::path > | nix::getSelfExe () |
| void nix::ensureStackSizeAtLeast | ( | size_t | stackSize | ) |
Increase the RLIMIT_STACK rlimit if it is currently smaller than stackSize.
| std::chrono::microseconds nix::getCpuUserTime | ( | ) |
Get the current process's user space CPU time.
| unsigned int nix::getMaxCPU | ( | ) |
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.
| std::optional< std::filesystem::path > nix::getSelfExe | ( | ) |
| void nix::restoreProcessContext | ( | bool | restoreMounts = true | ) |
Restore the original inherited Unix process context (such as signal masks, stack size).
See unix::startSignalHandlerThread(), unix::saveSignalMask().