13 #ifndef __STOUT_OS_PSTREE_HPP__ 14 #define __STOUT_OS_PSTREE_HPP__ 43 if (process.
parent == pid) {
48 children.push_back(tree.
get());
52 foreach (
const Process& process, processes) {
53 if (process.
pid == pid) {
68 }
else if (pid.get() == 0) {
78 return pstree(pid.get(), processes.
get());
85 const std::set<pid_t>&
pids,
88 std::list<ProcessTree> trees;
90 foreach (
pid_t pid, pids) {
93 bool disconnected =
true;
114 std::list<ProcessTree> trees_ = trees;
122 trees.push_back(tree.
get());
131 #endif // __STOUT_OS_PSTREE_HPP__ Definition: errorbase.hpp:36
T & get()&
Definition: try.hpp:80
bool contains(pid_t pid) const
Definition: process.hpp:96
const Process process
Definition: process.hpp:111
Try< std::list< ProcessTree > > pstrees(const std::set< pid_t > &, const std::list< Process > &)
Definition: pstree.hpp:84
Try< std::list< Process > > processes()
Definition: os.hpp:184
Definition: posix_signalhandler.hpp:23
DWORD pid_t
Definition: windows.hpp:181
Definition: process.hpp:32
const pid_t pid
Definition: process.hpp:53
static Try error(const E &e)
Definition: try.hpp:43
const pid_t parent
Definition: process.hpp:54
bool isError() const
Definition: try.hpp:78
std::set< pid_t > children(pid_t, const std::list< Process > &, bool)
Definition: os.hpp:217
Definition: executor.hpp:48
Try< ProcessTree > pstree(pid_t pid, const std::list< Process > &processes)
Definition: pstree.hpp:37
std::string stringify(int flags)
Definition: process.hpp:74
Try< std::set< pid_t > > pids()
Definition: freebsd.hpp:62