(kind: SessionKind)
| 40 | static SYSTEM: OnceLock<System> = OnceLock::new(); |
| 41 | |
| 42 | fn get_root_dir(kind: SessionKind) -> PathBuf { |
| 43 | let base_dir = if let Some(xdg_runtime_dir) = std::env::var_os("XDG_RUNTIME_DIR") { |
| 44 | PathBuf::from(xdg_runtime_dir) |
| 45 | } else { |
| 46 | std::env::temp_dir() |
| 47 | }; |
| 48 | |
| 49 | base_dir.join(kind.as_dir_name()) |
| 50 | } |
| 51 | |
| 52 | fn get_parent_pid(pid: pid_t) -> Option<pid_t> { |
| 53 | let s = SYSTEM.get_or_init(|| { |
no test coverage detected