23 #include <sys/types.h> 40 static const pid_t invalid_pid = 0;
52 throw std::runtime_error(
"Cannot construct instance for invalid pid.");
66 pid_t pgid = ::getpgid(
pid());
69 throw std::system_error(errno, std::system_category());
76 pid_t pgid = ::getpgid(
pid());
80 se = std::error_code(errno, std::system_category());
static Process invalid()
Returns an invalid instance for testing purposes.
The Process class models a process and possible operations on it.
The Signalable class abstracts the ability of an entity to be delivered a posix signal.
virtual ProcessGroup process_group_or_throw() const
Queries the id of the process group this process belongs to.
virtual ~Process() noexcept
Frees resources associated with the process.
Process(pid_t pid)
Creates a process instance wrapping an existing process.
virtual pid_t pid() const
Query the pid of the process.
virtual ProcessGroup process_group(std::error_code &se) const noexcept(true)
Queries the id of the process group this process belongs to.
The ProcessGroup class models a signalable group of process.