MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / default_socket_path

Method default_socket_path

crates/openshell-driver-podman/src/config.rs:227–243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225 /// using the real UID via `getuid()`.
226 #[must_use]
227 pub fn default_socket_path() -> PathBuf {
228 #[cfg(target_os = "macos")]
229 {
230 let home = std::env::var("HOME").expect("HOME must be set on macOS");
231 PathBuf::from(home).join(".local/share/containers/podman/machine/podman.sock")
232 }
233 #[cfg(target_os = "linux")]
234 {
235 std::env::var("XDG_RUNTIME_DIR").map_or_else(
236 |_| {
237 let uid = rustix::process::getuid().as_raw();
238 PathBuf::from(format!("/run/user/{uid}/podman/podman.sock"))
239 },
240 |xdg| PathBuf::from(xdg).join("podman/podman.sock"),
241 )
242 }
243 }
244}
245
246impl Default for PodmanComputeConfig {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected