MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / get_parent_pid

Function get_parent_pid

src/shell_session_store.rs:52–64  ·  view source on GitHub ↗
(pid: pid_t)

Source from the content-addressed store, hash-verified

50}
51
52fn get_parent_pid(pid: pid_t) -> Option<pid_t> {
53 let s = SYSTEM.get_or_init(|| {
54 System::new_with_specifics(
55 RefreshKind::nothing().with_processes(ProcessRefreshKind::nothing()),
56 )
57 });
58
59 let current_pid = Pid::from_u32(pid as u32);
60
61 s.process(current_pid)
62 .and_then(|p| p.parent())
63 .map(|pid| pid.as_u32() as pid_t)
64}
65
66fn get_state_file_path(base_dir: &Path, pid: pid_t) -> PathBuf {
67 base_dir.join(pid.to_string())

Callers 2

registerFunction · 0.85
loadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected