Lines Matching full:process

29 #include "utils/process/child.ipp"
49 #include "utils/process/exceptions.hpp"
50 #include "utils/process/fdstream.hpp"
51 #include "utils/process/operations.hpp"
52 #include "utils/process/system.hpp"
53 #include "utils/process/status.hpp"
59 namespace process { namespace
64 /// The process identifier.
67 /// The input stream for the process' stdout and stderr. May be NULL.
68 std::auto_ptr< process::ifdstream > _output;
72 /// \param pid The process identifier.
74 impl(const pid_t pid, process::ifdstream* output) : in impl()
79 } // namespace process
84 namespace process = utils::process;
97 /// \throw process::system_error If the call to dup2(2) fails.
101 if (process::detail::syscall_dup2(old_fd, new_fd) == -1) { in safe_dup()
103 throw process::system_error(F("dup2(%s, %s) failed") % old_fd % new_fd, in safe_dup()
115 /// \throw process::system_error If the call to open(2) fails.
119 const int fd = process::detail::syscall_open( in open_for_append()
124 throw process::system_error(F("Failed to create %s because open(2) " in open_for_append()
136 log_exec(const fs::path& program, const process::args_vector& args) in log_exec()
139 for (process::args_vector::const_iterator iter = args.begin(); in log_exec()
151 utils::process::detail::report_error_and_abort(void) in report_error_and_abort()
162 utils::process::detail::report_error_and_abort(const std::runtime_error& error) in report_error_and_abort()
173 process::child::child(impl *implptr) : in child()
180 process::child::~child(void) in ~child()
194 /// \throw process::system_error If the calls to pipe(2) or fork(2) fail.
195 std::auto_ptr< process::child >
196 process::child::fork_capture_aux(void) in fork_capture_aux()
203 throw process::system_error("pipe(2) failed", errno); in fork_capture_aux()
212 throw process::system_error("fork(2) failed", errno); in fork_capture_aux()
226 return std::auto_ptr< process::child >(NULL); in fork_capture_aux()
229 LD(F("Spawned process %s: stdout and stderr inherited") % pid); in fork_capture_aux()
232 return std::auto_ptr< process::child >( in fork_capture_aux()
233 new process::child(new impl(pid, new process::ifdstream(fds[0])))); in fork_capture_aux()
254 /// \throw process::system_error If the call to fork(2) fails.
255 std::auto_ptr< process::child >
256 process::child::fork_files_aux(const fs::path& stdout_file, in fork_files_aux()
267 throw process::system_error("fork(2) failed", errno); in fork_files_aux()
287 return std::auto_ptr< process::child >(NULL); in fork_files_aux()
289 LD(F("Spawned process %s: stdout=%s, stderr=%s") % pid % stdout_file % in fork_files_aux()
293 return std::auto_ptr< process::child >( in fork_files_aux()
294 new process::child(new impl(pid, NULL))); in fork_files_aux()
310 /// \throw process::system_error If the process cannot be spawned due to a
312 std::auto_ptr< process::child >
313 process::child::spawn_capture(const fs::path& program, const args_vector& args) in spawn_capture()
336 /// \throw process::system_error If the process cannot be spawned due to a
338 std::auto_ptr< process::child >
339 process::child::spawn_files(const fs::path& program, in spawn_files()
352 /// Returns the process identifier of this child.
354 /// \return A process identifier.
356 process::child::pid(void) const in pid()
369 process::child::output(void) in output()
378 /// \return The termination status of the child process.
380 /// \throw process::system_error If the call to waitpid(2) fails.
381 process::status
382 process::child::wait(void) in wait()
384 return process::wait(_pimpl->_pid); in wait()