summaryrefslogtreecommitdiff
path: root/src/sys/stat.rs
diff options
context:
space:
mode:
authorXavier L'Heureux <xavier.lheureux@icloud.com>2019-07-12 16:27:24 -0400
committerXavier L'Heureux <dev.xlheureux@gmail.com>2020-05-17 21:05:45 -0400
commit0259f9d51718b90118bbd1d792c88781d0aa98f7 (patch)
treec8d067b61393cb1628890790def3c6691c70bab6 /src/sys/stat.rs
parentd3fef370b843e0ffd6fc6df6e80d9bbe0d024863 (diff)
downloadnix-0259f9d51718b90118bbd1d792c88781d0aa98f7.zip
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
Diffstat (limited to 'src/sys/stat.rs')
-rw-r--r--src/sys/stat.rs4
1 files changed, 4 insertions, 0 deletions
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<FileStat> {
Ok(unsafe{dst.assume_init()})
}
+#[cfg(not(target_os = "redox"))]
pub fn fstatat<P: ?Sized + NixPath>(dirfd: RawFd, pathname: &P, f: AtFlags) -> Result<FileStat> {
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<P: ?Sized + NixPath>(
dirfd: Option<RawFd>,
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<P: ?Sized + NixPath>(
dirfd: Option<RawFd>,
path: &P,