Skip to content

Commit

Permalink
Rollup merge of #88177 - joshtriplett:stabilize-chroot, r=m-ou-se
Browse files Browse the repository at this point in the history
Stabilize std::os::unix::fs::chroot

I've verified that this works as documented, and I've tested it in (a nightly
build of) production software as a replacement for an unsafe call to
`libc::chroot`. It's been available in nightly for a few releases. I think it's
ready to stabilize.

---

Tracking issue: #84715
  • Loading branch information
m-ou-se committed Sep 2, 2021
2 parents fcce644 + 4046667 commit e50069f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/std/src/os/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,6 @@ impl DirBuilderExt for fs::DirBuilder {
/// # Examples
///
/// ```no_run
/// #![feature(unix_chroot)]
/// use std::os::unix::fs;
///
/// fn main() -> std::io::Result<()> {
Expand All @@ -944,7 +943,7 @@ impl DirBuilderExt for fs::DirBuilder {
/// Ok(())
/// }
/// ```
#[unstable(feature = "unix_chroot", issue = "84715")]
#[stable(feature = "unix_chroot", since = "1.56.0")]
#[cfg(not(any(target_os = "fuchsia", target_os = "vxworks")))]
pub fn chroot<P: AsRef<Path>>(dir: P) -> io::Result<()> {
sys::fs::chroot(dir.as_ref())
Expand Down

0 comments on commit e50069f

Please sign in to comment.