Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
processes.hh File Reference
#include "types.hh"
#include "error.hh"
#include "file-descriptor.hh"
#include "logging.hh"
#include "ansicolor.hh"
#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>

Go to the source code of this file.

Classes

class  nix::Pid
 
struct  nix::ProcessOptions
 
struct  nix::RunOptions
 
class  nix::ExecError
 

Functions

void nix::killUser (uid_t uid)
 
pid_t nix::startProcess (std::function< void()> fun, const ProcessOptions &options=ProcessOptions())
 
std::string nix::runProgram (Path program, bool lookupPath=false, const Strings &args=Strings(), const std::optional< std::string > &input={}, bool isInteractive=false)
 
std::pair< int, std::string > nix::runProgram (RunOptions &&options)
 
void nix::runProgram2 (const RunOptions &options)
 
std::string nix::statusToString (int status)
 
bool nix::statusOk (int status)
 

Function Documentation

◆ killUser()

void nix::killUser ( uid_t uid)

Kill all processes running under the specified uid by sending them a SIGKILL.

◆ runProgram()

std::string nix::runProgram ( Path program,
bool lookupPath = false,
const Strings & args = Strings(),
const std::optional< std::string > & input = {},
bool isInteractive = false )

Run a program and return its stdout in a string (i.e., like the shell backtick operator).

◆ statusToString()

std::string nix::statusToString ( int status)

Convert the exit status of a child as returned by wait() into an error string.