34 const std::vector<std::string>& argv,
35 const std::map<std::string, std::string>& env,
38 std::function<void()> null_function = [](){};
39 return exec(fn, argv, env, flags, null_function);
43 const std::vector<std::string>& argv,
44 const std::map<std::string, std::string>& env,
46 const std::function<
void()>& child_setup)
50 char** it;
char** pargv;
char** penv;
51 it = pargv =
new char*[argv.size()+2];
52 *it = ::strdup(fn.c_str());
54 for (
auto element : argv)
56 *it = ::strdup(element.c_str());
61 it = penv =
new char*[env.size()+1];
64 *it = ::strdup((pair.first +
"=" + pair.second).c_str());