about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2025-05-20 17:59:18 +0200
committerJosh Triplett <josh@joshtriplett.org>2025-05-20 18:25:06 +0200
commitc3b750ce0f6d1b40874f88b552d271abea3a3dde (patch)
tree77d2ff0cc5e94063160e4773bbf9bf750dd164a6
parenta3cf6f640828647e34afe96a626b3b4f6bbb22b1 (diff)
downloadrust-c3b750ce0f6d1b40874f88b552d271abea3a3dde.tar.gz
rust-c3b750ce0f6d1b40874f88b552d271abea3a3dde.zip
`CommandExt::chroot`: Document difference to underlying `chroot`
-rw-r--r--library/std/src/os/unix/process.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/library/std/src/os/unix/process.rs b/library/std/src/os/unix/process.rs
index 27866badfbe..8d238aa5835 100644
--- a/library/std/src/os/unix/process.rs
+++ b/library/std/src/os/unix/process.rs
@@ -203,9 +203,11 @@ pub trait CommandExt: Sealed {
     /// the command.
     ///
     /// This happens before changing to the directory specified with `Command::current_dir`, and
-    /// that directory will be relative to the new root. If no directory has been specified with
-    /// `Command::current_dir`, this will set the directory to `/`, to avoid leaving the current
-    /// directory outside the chroot.
+    /// that directory will be relative to the new root.
+    ///
+    /// If no directory has been specified with `Command::current_dir`, this will set the directory
+    /// to `/`, to avoid leaving the current directory outside the chroot. (This is an intentional
+    /// difference from the underlying `chroot` system call.)
     #[unstable(feature = "process_chroot", issue = "none")]
     fn chroot<P: AsRef<Path>>(&mut self, dir: P) -> &mut process::Command;
 }