13 #ifndef __STOUT_OS_PROCESS_HPP__ 14 #define __STOUT_OS_PROCESS_HPP__ 16 #include <sys/types.h> 41 const std::string& _command,
98 return find(pid).isSome();
120 const std::list<ProcessTree>& _children)
122 children(_children) {}
144 std::ostringstream out;
164 std::ostringstream out;
165 out <<
"[ " << std::endl;
166 std::list<os::ProcessTree>::const_iterator iterator = list.begin();
167 while (iterator != list.end()) {
169 if (++iterator != list.end()) {
170 out << std::endl << std::endl;
173 out << std::endl <<
"]";
177 #endif // __STOUT_OS_PROCESS_HPP__
Try< Bytes > size(const std::string &path, const FollowSymlink follow=FollowSymlink::FOLLOW_SYMLINK)
Definition: stat.hpp:130
const std::list< ProcessTree > children
Definition: process.hpp:112
bool contains(pid_t pid) const
Definition: process.hpp:96
const Process process
Definition: process.hpp:111
const pid_t group
Definition: process.hpp:55
bool operator!=(const Process &p) const
Definition: process.hpp:70
const Option< Bytes > rss
Definition: process.hpp:57
Definition: posix_signalhandler.hpp:23
const Option< pid_t > session
Definition: process.hpp:56
bool isSome() const
Definition: option.hpp:116
DWORD pid_t
Definition: windows.hpp:181
Definition: process.hpp:32
const pid_t pid
Definition: process.hpp:53
const bool zombie
Definition: process.hpp:61
bool operator>=(const Process &p) const
Definition: process.hpp:68
Option< ProcessTree > find(pid_t pid) const
Definition: process.hpp:79
const Option< Duration > utime
Definition: process.hpp:58
std::string stringify(const std::list< os::ProcessTree > &list)
Definition: process.hpp:162
std::string replace(const std::string &s, const std::string &from, const std::string &to)
Definition: strings.hpp:113
bool operator<(const Process &p) const
Definition: process.hpp:65
Try< std::vector< Entry > > list(const std::string &hierarchy, const std::string &cgroup)
bool operator<=(const Process &p) const
Definition: process.hpp:66
const pid_t parent
Definition: process.hpp:54
Result< Process > process(pid_t pid)
Definition: freebsd.hpp:30
const std::string command
Definition: process.hpp:60
bool operator>(const Process &p) const
Definition: process.hpp:67
std::set< pid_t > children(pid_t, const std::list< Process > &, bool)
Definition: os.hpp:217
Definition: executor.hpp:48
const Option< Duration > stime
Definition: process.hpp:59
Try< ProcessTree > pstree(pid_t pid, const std::list< Process > &processes)
Definition: pstree.hpp:37
std::ostream & operator<<(std::ostream &stream, const ProcessTree &tree)
Definition: process.hpp:126
bool operator==(const Process &p) const
Definition: process.hpp:69
Definition: process.hpp:74
Try< std::list< std::string > > find(const std::string &directory, const std::string &pattern)
Definition: find.hpp:37
Process(pid_t _pid, pid_t _parent, pid_t _group, const Option< pid_t > &_session, const Option< Bytes > &_rss, const Option< Duration > &_utime, const Option< Duration > &_stime, const std::string &_command, bool _zombie)
Definition: process.hpp:34