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

Function set_mount_namespace

crates/openshell-supervisor-process/src/process.rs:391–401  ·  view source on GitHub ↗
(fd: RawFd)

Source from the content-addressed store, hash-verified

389
390#[cfg(target_os = "linux")]
391fn set_mount_namespace(fd: RawFd) -> std::io::Result<()> {
392 #[allow(unsafe_code)]
393 let rc = unsafe { libc::setns(fd, libc::CLONE_NEWNS) };
394 if rc != 0 {
395 return Err(std::io::Error::other(format!(
396 "failed to enter mount namespace: {}",
397 std::io::Error::last_os_error()
398 )));
399 }
400 Ok(())
401}
402
403#[cfg(target_os = "linux")]
404fn mount_empty_tmpfs(target: &CString) -> std::io::Result<()> {

Callers 2

enter_for_childMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected