From 0259f9d51718b90118bbd1d792c88781d0aa98f7 Mon Sep 17 00:00:00 2001 From: Xavier L'Heureux Date: Fri, 12 Jul 2019 16:27:24 -0400 Subject: Add Redox support for most of the modules Some things are not implemented yet in redox, so a lot of annotations were added to remove functions when compiling for redox. Those functions will hopefully be added in time, but for now it's better to have partial support than none. Blocked by https://github.com/rust-lang/libc/pull/1438 --- src/sys/stat.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sys/stat.rs') diff --git a/src/sys/stat.rs b/src/sys/stat.rs index 29582251..5d426844 100644 --- a/src/sys/stat.rs +++ b/src/sys/stat.rs @@ -3,6 +3,7 @@ pub use libc::stat as FileStat; use {Result, NixPath}; use errno::Errno; +#[cfg(not(target_os = "redox"))] use fcntl::{AtFlags, at_rawfd}; use libc; use std::mem; @@ -112,6 +113,7 @@ pub fn fstat(fd: RawFd) -> Result { Ok(unsafe{dst.assume_init()}) } +#[cfg(not(target_os = "redox"))] pub fn fstatat(dirfd: RawFd, pathname: &P, f: AtFlags) -> Result { let mut dst = mem::MaybeUninit::uninit(); let res = pathname.with_nix_path(|cstr| { @@ -157,6 +159,7 @@ pub enum FchmodatFlags { /// # References /// /// [fchmodat(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchmodat.html). +#[cfg(not(target_os = "redox"))] pub fn fchmodat( dirfd: Option, path: &P, @@ -260,6 +263,7 @@ pub enum UtimensatFlags { /// # References /// /// [utimensat(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/utimens.html). +#[cfg(not(target_os = "redox"))] pub fn utimensat( dirfd: Option, path: &P, -- cgit v1.2.3