Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
current-process.hh File Reference
#include <optional>
#include <sys/resource.h>
#include "types.hh"

Go to the source code of this file.

Functions

unsigned int nix::getMaxCPU ()
 
void nix::setStackSize (size_t stackSize)
 
void nix::restoreProcessContext (bool restoreMounts)
 
std::optional< Pathnix::getSelfExe ()
 

Function Documentation

◆ getMaxCPU()

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.

◆ getSelfExe()

std::optional< Path > nix::getSelfExe ( )
Returns
the path of the current executable.

◆ restoreProcessContext()

void nix::restoreProcessContext ( bool restoreMounts = true)

Restore the original inherited Unix process context (such as signal masks, stack size).

See unix::startSignalHandlerThread(), unix::saveSignalMask().

◆ setStackSize()

void nix::setStackSize ( size_t stackSize)

Change the stack size.