26 bool separatePG =
false;
27 int killSignal = SIGKILL;
30 explicit Pid(pid_t pid): pid(pid) {}
32 Pid & operator=(
Pid && other);
33 ~Pid()
noexcept(
false);
34 explicit operator bool()
const {
return pid != -1; }
38 void setSeparatePG(
bool separatePG);
39 void setKillSignal(
int signal);
41 pid_t get()
const {
return pid; }
48void killUser(uid_t uid);
57 std::string errorPrefix =
"";
58 bool dieWithParent =
true;
59 bool runExitHandlers =
false;
74std::string runProgram(
Path program,
bool searchPath =
false,
75 const Strings & args = Strings(),
bool isInteractive =
false);
80 bool searchPath =
true;
82 std::optional<uid_t> uid = {};
83 std::optional<uid_t> gid = {};
84 std::optional<Path> chdir = {};
85 std::optional<std::map<std::string, std::string>> environment = {};
86 bool captureStdout =
false;
87 bool mergeStderrToStdout =
false;
88 bool isInteractive =
false;
98 std::unique_ptr<Source> stdoutSource;
109 Source * getStdout()
const {
return stdoutSource.get(); };
112std::pair<int, std::string> runProgram(
RunOptions && options);
121 template<
typename...
Args>
123 : Error(args...), status(status)
131std::string statusToString(
int status);
133bool statusOk(
int status);
Definition file-descriptor.hh:42
Definition processes.hh:117
Definition processes.hh:24
This file defines two main structs/classes used in nix error handling.
Definition processes.hh:56
int cloneFlags
Definition processes.hh:63
Definition processes.hh:78
Definition processes.hh:92
Definition serialise.hh:66
std::string Path
Definition types.hh:28