Rollup merge of #127480 - biabbas:vxworks, r=workingjubilee · model-checking/verify-rust-std@9b1cffd (original) (raw)
`@@ -857,6 +857,7 @@ impl Drop for Dir {
`
857
857
` target_os = "espidf",
`
858
858
` target_os = "fuchsia",
`
859
859
` target_os = "horizon",
`
``
860
`+
target_os = "vxworks",
`
860
861
`)))]
`
861
862
`{
`
862
863
`let fd = unsafe { libc::dirfd(self.0) };
`
`@@ -1313,7 +1314,12 @@ impl File {
`
1313
1314
`}
`
1314
1315
``
1315
1316
`pub fn set_times(&self, times: FileTimes) -> io::Result<()> {
`
1316
``
`-
#[cfg(not(any(target_os = "redox", target_os = "espidf", target_os = "horizon")))]
`
``
1317
`+
#[cfg(not(any(
`
``
1318
`+
target_os = "redox",
`
``
1319
`+
target_os = "espidf",
`
``
1320
`+
target_os = "horizon",
`
``
1321
`+
target_os = "vxworks"
`
``
1322
`+
)))]
`
1317
1323
`let to_timespec = |time: Option| match time {
`
1318
1324
`Some(time) if let Some(ts) = time.t.to_timespec() => Ok(ts),
`
1319
1325
`Some(time) if time > crate::sys::time::UNIX_EPOCH => Err(io::const_io_error!(
`
`@@ -1327,10 +1333,11 @@ impl File {
`
1327
1333
`None => Ok(libc::timespec { tv_sec: 0, tv_nsec: libc::UTIME_OMIT as _ }),
`
1328
1334
`};
`
1329
1335
` cfg_if::cfg_if! {
`
1330
``
`-
if #[cfg(any(target_os = "redox", target_os = "espidf", target_os = "horizon"))] {
`
``
1336
`+
if #[cfg(any(target_os = "redox", target_os = "espidf", target_os = "horizon", target_os = "vxworks"))] {
`
1331
1337
`` // Redox doesn't appear to support UTIME_OMIT
.
``
1332
1338
`` // ESP-IDF and HorizonOS do not support futimens
at all and the behavior for those OS is therefore
``
1333
1339
`// the same as for Redox.
`
``
1340
`` +
// futimens
and UTIME_OMIT
are a work in progress for vxworks.
``
1334
1341
`let _ = times;
`
1335
1342
`Err(io::const_io_error!(
`
1336
1343
` io::ErrorKind::Unsupported,
`
`@@ -1962,18 +1969,31 @@ pub fn fchown(fd: c_int, uid: u32, gid: u32) -> io::Result<()> {
`
1962
1969
`Ok(())
`
1963
1970
`}
`
1964
1971
``
``
1972
`+
#[cfg(not(target_os = "vxworks"))]
`
1965
1973
`pub fn lchown(path: &Path, uid: u32, gid: u32) -> io::Result<()> {
`
1966
1974
`run_path_with_cstr(path, &|path| {
`
1967
1975
`cvt(unsafe { libc::lchown(path.as_ptr(), uid as libc::uid_t, gid as libc::gid_t) })
`
1968
1976
`.map(|_| ())
`
1969
1977
`})
`
1970
1978
`}
`
1971
1979
``
``
1980
`+
#[cfg(target_os = "vxworks")]
`
``
1981
`+
pub fn lchown(path: &Path, uid: u32, gid: u32) -> io::Result<()> {
`
``
1982
`+
let (_, _, _) = (path, uid, gid);
`
``
1983
`+
Err(io::const_io_error!(io::ErrorKind::Unsupported, "lchown not supported by vxworks"))
`
``
1984
`+
}
`
``
1985
+
1972
1986
`#[cfg(not(any(target_os = "fuchsia", target_os = "vxworks")))]
`
1973
1987
`pub fn chroot(dir: &Path) -> io::Result<()> {
`
1974
1988
`run_path_with_cstr(dir, &|dir| cvt(unsafe { libc::chroot(dir.as_ptr()) }).map(|_| ()))
`
1975
1989
`}
`
1976
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
+
1977
1997
`pub use remove_dir_impl::remove_dir_all;
`
1978
1998
``
1979
1999
`// Fallback for REDOX, ESP-ID, Horizon, Vita, Vxworks and Miri
`