13 #ifndef __STOUT_OS_HPP__ 14 #define __STOUT_OS_HPP__ 23 #include <glog/logging.h> 24 #include <sys/types.h> 101 #endif // __WINDOWS__ 108 #elif defined(__WINDOWS__) 121 #elif defined(__WINDOWS__) 131 inline std::string
expandName(
const std::string& libraryName)
141 return path.
isSome() ? path.
get() : std::string();
158 if (
paths().empty()) {
179 return info->sysname;
181 #endif // __WINDOWS__ 191 std::list<Process> result;
197 result.push_back(process.
get());
209 if (process.
pid == pid) {
220 bool recursive =
true)
223 std::set<pid_t> descendants;
224 std::queue<pid_t> parents;
228 pid_t parent = parents.front();
233 if (process.
parent == parent) {
235 if (descendants.insert(process.
pid).second) {
236 parents.push(process.
pid);
240 }
while (recursive && !parents.empty());
259 #endif // __STOUT_OS_HPP__
Try< std::string > sysname()
Definition: os.hpp:172
Definition: errorbase.hpp:36
T & get()&
Definition: try.hpp:80
constexpr const char * extension
Definition: os.hpp:105
Try< std::list< Process > > processes()
Definition: os.hpp:184
constexpr const char * prefix
Definition: os.hpp:96
std::string paths()
Definition: os.hpp:138
Definition: posix_signalhandler.hpp:23
void setenv(const std::string &key, const std::string &value, bool overwrite=true)
Definition: os.hpp:157
bool isSome() const
Definition: option.hpp:116
void setPaths(const std::string &newPaths)
Definition: os.hpp:148
DWORD pid_t
Definition: windows.hpp:181
Definition: process.hpp:32
void appendPaths(const std::string &newPaths)
Definition: os.hpp:156
const pid_t pid
Definition: process.hpp:53
const T & get() const &
Definition: option.hpp:119
Option< std::string > getenv(const std::string &key)
Definition: getenv.hpp:29
constexpr const char * ldPathEnvironmentVariable
Definition: os.hpp:118
Try< UTSInfo > uname()
Definition: os.hpp:297
static Try error(const E &e)
Definition: try.hpp:43
const pid_t parent
Definition: process.hpp:54
Result< Process > process(pid_t pid)
Definition: freebsd.hpp:30
bool isError() const
Definition: try.hpp:78
T & get()&
Definition: result.hpp:116
std::set< pid_t > children(pid_t, const std::list< Process > &, bool)
Definition: os.hpp:217
Definition: executor.hpp:48
bool isSome() const
Definition: result.hpp:112
std::string expandName(const std::string &libraryName)
Definition: os.hpp:131
Try< std::set< pid_t > > pids()
Definition: freebsd.hpp:62