Add chroot unsupported implementation for VxWorks · patricklam/verify-rust-std@697c717 (original) (raw)

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -1064,7 +1064,7 @@ pub fn lchown<P: AsRef>(dir: P, uid: Option, gid: Option) -> io:
1064 1064 /// }
1065 1065 /// ```
1066 1066 #[stable(feature = "unix_chroot", since = "1.56.0")]
1067 -#[cfg(not(any(target_os = "fuchsia", target_os = "vxworks")))]
1067 +#[cfg(not(target_os = "fuchsia"))]
1068 1068 pub fn chroot<P: AsRef<Path>>(dir: P) -> io::Result<()> {
1069 1069 sys::fs::chroot(dir.as_ref())
1070 1070 }
Original file line number Diff line number Diff line change
@@ -1980,14 +1980,20 @@ pub fn lchown(path: &Path, uid: u32, gid: u32) -> io::Result<()> {
1980 1980 #[cfg(target_os = "vxworks")]
1981 1981 pub fn lchown(path: &Path, uid: u32, gid: u32) -> io::Result<()> {
1982 1982 let (_, _, _) = (path, uid, gid);
1983 -Err(io::const_io_error!(io::ErrorKind::Unsupported, "lchown not supported by vxworks",))
1983 +Err(io::const_io_error!(io::ErrorKind::Unsupported, "lchown not supported by vxworks"))
1984 1984 }
1985 1985
1986 1986 #[cfg(not(any(target_os = "fuchsia", target_os = "vxworks")))]
1987 1987 pub fn chroot(dir: &Path) -> io::Result<()> {
1988 1988 run_path_with_cstr(dir, &|dir
1989 1989 }
1990 1990
1991 +#[cfg(target_os = "vxworks")]
1992 +pub fn chroot(dir: &Path) -> io::Result<()> {
1993 +let _ = dir;
1994 +Err(io::const_io_error!(io::ErrorKind::Unsupported, "chroot not supported by vxworks"))
1995 +}
1996 +
1991 1997 pub use remove_dir_impl::remove_dir_all;
1992 1998
1993 1999 // Fallback for REDOX, ESP-ID, Horizon, Vita, Vxworks and Miri