(fd: RawFd)
| 389 | |
| 390 | #[cfg(target_os = "linux")] |
| 391 | fn 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")] |
| 404 | fn mount_empty_tmpfs(target: &CString) -> std::io::Result<()> { |
no outgoing calls
no test coverage detected