mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
ac89bb064a
All OS and IO operations should be moved out, leaving only some misc portable pure functions. This is useful to avoid copious CPP when doing things like Windows and Emscripten ports. Newly exposed functions to break cycles: - `restoreSignals` - `updateWindowSize`
34 lines
641 B
C++
34 lines
641 B
C++
#pragma once
|
|
///@file
|
|
|
|
#include <optional>
|
|
|
|
#include "types.hh"
|
|
|
|
namespace nix {
|
|
|
|
/**
|
|
* 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();
|
|
|
|
/**
|
|
* Change the stack size.
|
|
*/
|
|
void setStackSize(size_t stackSize);
|
|
|
|
/**
|
|
* Restore the original inherited Unix process context (such as signal
|
|
* masks, stack size).
|
|
|
|
* See startSignalHandlerThread(), saveSignalMask().
|
|
*/
|
|
void restoreProcessContext(bool restoreMounts = true);
|
|
|
|
/**
|
|
* @return the path of the current executable.
|
|
*/
|
|
std::optional<Path> getSelfExe();
|
|
|
|
}
|