| 35 | #include <errno.h> |
| 36 | |
| 37 | static int execvp (const std::string& file, const std::vector<std::string>& args) |
| 38 | { |
| 39 | std::vector<const char*> args_c_str; |
| 40 | args_c_str.reserve(args.size()); |
| 41 | for (std::vector<std::string>::const_iterator arg(args.begin()); arg != args.end(); ++arg) { |
| 42 | args_c_str.push_back(arg->c_str()); |
| 43 | } |
| 44 | args_c_str.push_back(nullptr); |
| 45 | return execvp(file.c_str(), const_cast<char**>(&args_c_str[0])); |
| 46 | } |
| 47 | |
| 48 | Coprocess::Coprocess () |
| 49 | { |