// Executes the command. If `wait` is true, waits for the process to finish and keeps it in a // waitable state; otherwise, returns immediately after fork. When the current scope exits, destroys // the process.
[[maybe_unused]] static std::pair<pid_t, std::unique_ptr<ScopeGuard<std::function<void()>>>>
ScopedExec(std::vector<std::string>& args, bool wait) {
std::vector<char*> execv_args;
execv_args.reserve(args.size() + 1); for (std::string& arg : args) {
execv_args.push_back(arg.data());
}
execv_args.push_back(nullptr);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.