13 #ifndef __PROCESS_WINDOWS_SUBPROCESS_HPP__ 14 #define __PROCESS_WINDOWS_SUBPROCESS_HPP__ 21 #include <glog/logging.h> 47 const std::string&
path,
48 const std::vector<std::string>& argv,
50 const std::vector<Subprocess::ParentHook>& parent_hooks,
54 const std::vector<int_fd>& whitelist_fds = {})
56 const std::array<int_fd, 3> fds{
70 foreach (
const int_fd& fd, fds) {
98 "Failed to execute Parent Hook in child '" +
stringify(pid) +
99 "' with command '" +
stringify(argv) +
"': " +
100 parent_setup.
error());
107 "Failed to resume child process with command '" +
117 #endif // __PROCESS_WINDOWS_SUBPROCESS_HPP__
Definition: errorbase.hpp:36
Definition: option.hpp:29
Try< os::windows::internal::ProcessData > createChildProcess(const std::string &path, const std::vector< std::string > &argv, const Option< std::map< std::string, std::string >> &environment, const std::vector< Subprocess::ParentHook > &parent_hooks, const InputFileDescriptors &stdinfds, const OutputFileDescriptors &stdoutfds, const OutputFileDescriptors &stderrfds, const std::vector< int_fd > &whitelist_fds={})
Definition: subprocess.hpp:46
HANDLE get_handle() const
Definition: windows.hpp:90
Try< ProcessData > create_process(const std::string &command, const std::vector< std::string > &argv, const Option< std::map< std::string, std::string >> &environment, const bool create_suspended=false, const Option< std::array< int_fd, 3 >> &pipes=None(), const std::vector< int_fd > &whitelist_fds={})
Definition: exec.hpp:263
Definition: error.hpp:108
For output file descriptors a child writes to the write file descriptor and a parent may read from th...
Definition: subprocess.hpp:89
SharedHandle process_handle
Definition: exec.hpp:223
SharedHandle thread_handle
Definition: exec.hpp:224
Environment * environment
DWORD pid_t
Definition: windows.hpp:181
int_fd write
Definition: subprocess.hpp:92
Try< Nothing > close(int fd)
Definition: close.hpp:24
static Try error(const E &e)
Definition: try.hpp:43
const lambda::function< Try< Nothing >pid_t)> parent_setup
The callback that must be specified for execution after the child has been cloned, but before it starts executing the new process.
Definition: subprocess.hpp:164
Definition: attributes.hpp:24
bool isError() const
Definition: try.hpp:78
Definition: executor.hpp:48
pid_t pid
Definition: exec.hpp:225
A hook can be passed to a subprocess call.
Definition: subprocess.hpp:153
int int_fd
Definition: int_fd.hpp:35
std::string stringify(int flags)