131 const std::string& executableName,
132 const std::string& configPath);
139 std::chrono::milliseconds timeout,
140 std::chrono::milliseconds pollInterval = std::chrono::milliseconds(20));
Identity
Whether the process behind a pid still is the one we think it is.
@ Unverifiable
argv could not be read, so nothing can be concluded either way.
@ Matches
argv says this is the expected executable, and it does not claim a foreign config.
@ Differs
argv says this is a different program, or the same program serving a different config.
std::string GetProcessName(int pid)
Reads the name of the executable behind pid (the basename of argv[0]).
Identity IdentifyProcess(int pid, const std::string &executableName, const std::string &configPath)
Checks whether the process with the given pid is still the application it is supposed to be.
std::optional< std::string > FindIceConfigArgument(const std::vector< std::string > &arguments)
bool WaitForExit(int pid, std::chrono::milliseconds timeout, std::chrono::milliseconds pollInterval)
Blocks until the process with the given pid has disappeared, at most for timeout.
std::vector< std::string > GetProcessArguments(int pid)
Reads the full argument vector of pid from /proc/<pid>/cmdline.
std::vector< ProcessInfo > ScanProcesses()
Walks /proc and returns every process whose argument vector could be read.
A live process as seen by ScanProcesses().
std::vector< std::string > arguments
The full argument vector, argv[0] included.
std::string name
Basename of argv[0].