10 #define STDIN_FILENO 0 13 #define STDOUT_FILENO 1 16 #define STDERR_FILENO 2 21 #include <core/util/syserr_reporting.hpp> 24 #include <cross_platform/windows_wrapper.hpp> 27 #include <sys/types.h> 54 bool launch(
const std::string &cmd,
55 const std::vector<std::string> &args);
79 bool popen(
const std::string &cmd,
80 const std::vector<std::string> &args,
81 int target_child_write_fd,
82 bool open_write_pipe=
false);
92 std::string read_from_child();
108 bool kill(
bool async=
true);
125 void close_read_pipe();
149 HANDLE m_proc_handle = NULL;
152 HANDLE m_read_handle = NULL;
155 HANDLE m_write_handle = NULL;
158 HANDLE m_stderr_handle = NULL;
159 HANDLE m_stdout_handle = NULL;
161 DWORD m_pid = DWORD(-1);
163 BOOL m_launched = FALSE;
165 BOOL m_launched_with_popen = FALSE;
170 int m_read_handle = -1;
171 int m_write_handle = -1;
175 bool m_launched =
false;
177 bool m_launched_with_popen =
false;
ssize_t read_from_child(void *buf, size_t count)
bool launch(const std::string &cmd, const std::vector< std::string > &args)
bool write_to_child(const void *buf, size_t count)
void set_nonblocking(bool nonblocking)
bool kill(bool async=true)
bool popen(const std::string &cmd, const std::vector< std::string > &args, int target_child_write_fd, bool open_write_pipe=false)