diff options
Diffstat (limited to 'test/test_unistd.rs')
-rw-r--r-- | test/test_unistd.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test_unistd.rs b/test/test_unistd.rs index 94d2d1b9..1609c853 100644 --- a/test/test_unistd.rs +++ b/test/test_unistd.rs @@ -1,6 +1,6 @@ #[cfg(not(target_os = "redox"))] use nix::fcntl::{self, open, readlink}; -use nix::fcntl::{fcntl, FcntlArg, FdFlag, OFlag}; +use nix::fcntl::OFlag; use nix::unistd::*; use nix::unistd::ForkResult::*; #[cfg(not(target_os = "redox"))] @@ -13,14 +13,14 @@ use nix::errno::Errno; #[cfg(not(target_os = "redox"))] use nix::Error; use std::{env, iter}; -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] use std::ffi::CString; #[cfg(not(target_os = "redox"))] use std::fs::DirBuilder; use std::fs::{self, File}; use std::io::Write; use std::os::unix::prelude::*; -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] use std::path::Path; use tempfile::{tempdir, tempfile}; use libc::{_exit, mode_t, off_t}; @@ -135,6 +135,8 @@ fn test_mkfifoat_none() { target_os = "macos", target_os = "ios", target_os = "android", target_os = "redox")))] fn test_mkfifoat() { + use nix::fcntl; + let tempdir = tempdir().unwrap(); let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); let mkfifoat_name = "mkfifoat_name"; @@ -258,7 +260,7 @@ fn test_initgroups() { setgroups(&old_groups).unwrap(); } -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] macro_rules! execve_test_factory( ($test_name:ident, $syscall:ident, $exe: expr $(, $pathname:expr, $flags:expr)*) => ( @@ -669,6 +671,8 @@ fn test_pipe() { target_os = "solaris"))] #[test] fn test_pipe2() { + use nix::fcntl::{fcntl, FcntlArg, FdFlag}; + let (fd0, fd1) = pipe2(OFlag::O_CLOEXEC).unwrap(); let f0 = FdFlag::from_bits_truncate(fcntl(fd0, FcntlArg::F_GETFD).unwrap()); assert!(f0.contains(FdFlag::FD_CLOEXEC)); |