![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include "nix/util/types.hh"#include "nix/util/error.hh"#include "nix/util/fun.hh"#include "nix/util/file-descriptor.hh"#include "nix/util/logging.hh"#include "nix/util/ansicolor.hh"#include "nix/util/os-string.hh"#include <filesystem>#include <sys/types.h>#include <sys/stat.h>#include <dirent.h>#include <unistd.h>#include <signal.h>#include <atomic>#include <functional>#include <map>#include <sstream>#include <optional>#include <thread>Go to the source code of this file.
Classes | |
| class | nix::Pid |
| struct | nix::ProcessOptions |
| struct | nix::SpawnOptions |
| struct | nix::RunOptions |
| struct | nix::FdRedirection |
| class | nix::ExecError |
Functions | |
| void | nix::killUser (uid_t uid) |
| pid_t | nix::startProcess (fun< void()> processMain, const ProcessOptions &options=ProcessOptions()) |
| const std::filesystem::path & | nix::shProgram () |
| std::string | nix::runProgram (std::filesystem::path program, bool lookupPath=false, const OsStrings &args=OsStrings(), bool isInteractive=false) |
| std::pair< int, std::string > | nix::runProgram (RunOptions &&options) |
| Pid | nix::spawnProgram (const SpawnOptions &options, std::span< const FdRedirection > fdr) |
| Spawn a program as a subprocess. | |
| void | nix::runProgram2 (const RunOptions &options) |
| std::string | nix::statusToString (int status) |
| bool | nix::statusOk (int status) |
| void nix::killUser | ( | uid_t | uid | ) |
Kill all processes running under the specified uid by sending them a SIGKILL.
| std::string nix::runProgram | ( | std::filesystem::path | program, |
| bool | lookupPath = false, | ||
| const OsStrings & | args = OsStrings(), | ||
| bool | isInteractive = false ) |
Run a program and return its stdout in a string (i.e., like the shell backtick operator).
| const std::filesystem::path & nix::shProgram | ( | ) |
The POSIX shell used to run command strings with -c (build-time configurable via the sh-program option; always an absolute path).
| Pid nix::spawnProgram | ( | const SpawnOptions & | options, |
| std::span< const FdRedirection > | fdr ) |
Spawn a program as a subprocess.
| SysError | if fork() or vfork() fail in the parent, ExecError if housekeeping fails with status code 127 (as does posix_spawn). |
| fdr | Unless specified, standard in, out and error are inherited. Redirections are applied in the same order in the child housekeeping. It's the callers responsibility to ensure that the redirected file descriptors are inheritable. |
| std::string nix::statusToString | ( | int | status | ) |
Convert the exit status of a child as returned by wait() into an error string.