Rollup merge of #88177 - joshtriplett:stabilize-chroot, r=m-ou-se
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: https://github.com/rust-lang/rust/issues/84715
This commit is contained in:
commit
e50069ff4f
1 changed files with 1 additions and 2 deletions
|
@ -934,7 +934,6 @@ impl DirBuilderExt for fs::DirBuilder {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// #![feature(unix_chroot)]
|
|
||||||
/// use std::os::unix::fs;
|
/// use std::os::unix::fs;
|
||||||
///
|
///
|
||||||
/// fn main() -> std::io::Result<()> {
|
/// fn main() -> std::io::Result<()> {
|
||||||
|
@ -944,7 +943,7 @@ impl DirBuilderExt for fs::DirBuilder {
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "unix_chroot", issue = "84715")]
|
#[stable(feature = "unix_chroot", since = "1.56.0")]
|
||||||
#[cfg(not(any(target_os = "fuchsia", target_os = "vxworks")))]
|
#[cfg(not(any(target_os = "fuchsia", target_os = "vxworks")))]
|
||||||
pub fn chroot<P: AsRef<Path>>(dir: P) -> io::Result<()> {
|
pub fn chroot<P: AsRef<Path>>(dir: P) -> io::Result<()> {
|
||||||
sys::fs::chroot(dir.as_ref())
|
sys::fs::chroot(dir.as_ref())
|
||||||
|
|
Loading…
Add table
Reference in a new issue