| 1 | #[cfg(feature = "fs")] |
|---|---|
| 2 | #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] |
| 3 | use crate::{backend, io, path}; |
| 4 | |
| 5 | /// `chroot(path)`—Change the process root directory. |
| 6 | /// |
| 7 | /// # References |
| 8 | /// - [Linux] |
| 9 | /// |
| 10 | /// [Linux]: https://man7.org/linux/man-pages/man2/chroot.2.html |
| 11 | #[cfg(feature = "fs")] |
| 12 | #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] |
| 13 | #[inline] |
| 14 | pub fn chroot<P: path::Arg>(path: P) -> io::Result<()> { |
| 15 | path.into_with_c_str(backend::process::syscalls::chroot) |
| 16 | } |
| 17 |
