Lines Matching refs: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 {
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) :
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) {
103 throw process::system_error(F("dup2(%s, %s) failed") % old_fd % new_fd,
115 /// \throw process::system_error If the call to open(2) fails.
119 const int fd = process::detail::syscall_open(
124 throw process::system_error(F("Failed to create %s because open(2) "
136 log_exec(const fs::path& program, const process::args_vector& args)
139 for (process::args_vector::const_iterator iter = args.begin();
151 utils::process::detail::report_error_and_abort(void)
162 utils::process::detail::report_error_and_abort(const std::runtime_error& error)
173 process::child::child(impl *implptr) :
180 process::child::~child(void)
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)
203 throw process::system_error("pipe(2) failed", errno);
212 throw process::system_error("fork(2) failed", errno);
226 return std::auto_ptr< process::child >(NULL);
229 LD(F("Spawned process %s: stdout and stderr inherited") % pid);
232 return std::auto_ptr< process::child >(
233 new process::child(new impl(pid, new process::ifdstream(fds[0]))));
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,
267 throw process::system_error("fork(2) failed", errno);
287 return std::auto_ptr< process::child >(NULL);
289 LD(F("Spawned process %s: stdout=%s, stderr=%s") % pid % stdout_file %
293 return std::auto_ptr< process::child >(
294 new process::child(new impl(pid, NULL)));
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)
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,
352 /// Returns the process identifier of this child.
354 /// \return A process identifier.
356 process::child::pid(void) const
369 process::child::output(void)
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)
384 return process::wait(_pimpl->_pid);