summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorXavier L'Heureux <xavier.lheureux@icloud.com>2019-07-16 15:02:54 -0400
committerXavier L'Heureux <dev.xlheureux@gmail.com>2020-05-17 21:05:45 -0400
commite94c139a47055d3492d6ccccfce4acbcba9d7391 (patch)
tree7419cc1c1461cda63e4e2a735fd75e4a48677f81 /src/sys
parent0259f9d51718b90118bbd1d792c88781d0aa98f7 (diff)
downloadnix-e94c139a47055d3492d6ccccfce4acbcba9d7391.zip
Remove more unsupported functions and make it possible to run tests
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/signal.rs22
-rw-r--r--src/sys/stat.rs1
2 files changed, 12 insertions, 11 deletions
diff --git a/src/sys/signal.rs b/src/sys/signal.rs
index ad5cc031..b49a9f53 100644
--- a/src/sys/signal.rs
+++ b/src/sys/signal.rs
@@ -464,6 +464,7 @@ impl SigSet {
/// Suspends execution of the calling thread until one of the signals in the
/// signal mask becomes pending, and returns the accepted signal.
+ #[cfg(not(target_os = "redox"))]
pub fn wait(&self) -> Result<Signal> {
let mut signum = mem::MaybeUninit::uninit();
let res = unsafe { libc::sigwait(&self.sigset as *const libc::sigset_t, signum.as_mut_ptr()) };
@@ -890,6 +891,7 @@ mod sigevent {
#[cfg(test)]
mod tests {
+ #[cfg(not(target_os = "redox"))]
use std::thread;
use super::*;
@@ -945,6 +947,7 @@ mod tests {
}
#[test]
+ #[cfg(not(target_os = "redox"))]
fn test_thread_signal_set_mask() {
thread::spawn(|| {
let prev_mask = SigSet::thread_get_mask()
@@ -965,6 +968,7 @@ mod tests {
}
#[test]
+ #[cfg(not(target_os = "redox"))]
fn test_thread_signal_block() {
thread::spawn(|| {
let mut mask = SigSet::empty();
@@ -977,6 +981,7 @@ mod tests {
}
#[test]
+ #[cfg(not(target_os = "redox"))]
fn test_thread_signal_unblock() {
thread::spawn(|| {
let mut mask = SigSet::empty();
@@ -989,6 +994,7 @@ mod tests {
}
#[test]
+ #[cfg(not(target_os = "redox"))]
fn test_thread_signal_swap() {
thread::spawn(|| {
let mut mask = SigSet::empty();
@@ -1011,23 +1017,14 @@ mod tests {
}
#[test]
+ #[cfg(not(target_os = "redox"))]
fn test_sigaction() {
use libc;
thread::spawn(|| {
extern fn test_sigaction_handler(_: libc::c_int) {}
- #[cfg(not(target_os = "redox"))]
extern fn test_sigaction_action(_: libc::c_int,
_: *mut libc::siginfo_t, _: *mut libc::c_void) {}
- #[cfg(not(target_os = "redox"))]
- fn test_sigaction_sigaction(flags: SaFlags, mask: SigSet) {
- let handler_act = SigHandler::SigAction(test_sigaction_action);
- let action_act = SigAction::new(handler_act, flags, mask);
- assert_eq!(action_act.handler(), handler_act);
- }
- #[cfg(target_os = "redox")]
- fn test_sigaction_sigaction() {}
-
let handler_sig = SigHandler::Handler(test_sigaction_handler);
let flags = SaFlags::SA_ONSTACK | SaFlags::SA_RESTART |
@@ -1046,7 +1043,9 @@ mod tests {
assert!(mask.contains(SIGUSR1));
assert!(!mask.contains(SIGUSR2));
- test_sigaction_sigaction(flags, mask);
+ let handler_act = SigHandler::SigAction(test_sigaction_action);
+ let action_act = SigAction::new(handler_act, flags, mask);
+ assert_eq!(action_act.handler(), handler_act);
let action_dfl = SigAction::new(SigHandler::SigDfl, flags, mask);
assert_eq!(action_dfl.handler(), SigHandler::SigDfl);
@@ -1057,6 +1056,7 @@ mod tests {
}
#[test]
+ #[cfg(not(target_os = "redox"))]
fn test_sigwait() {
thread::spawn(|| {
let mut mask = SigSet::empty();
diff --git a/src/sys/stat.rs b/src/sys/stat.rs
index 5d426844..f8fae4ee 100644
--- a/src/sys/stat.rs
+++ b/src/sys/stat.rs
@@ -289,6 +289,7 @@ pub fn utimensat<P: ?Sized + NixPath>(
Errno::result(res).map(drop)
}
+#[cfg(not(target_os = "redox"))]
pub fn mkdirat<P: ?Sized + NixPath>(fd: RawFd, path: &P, mode: Mode) -> Result<()> {
let res = path.with_nix_path(|cstr| {
unsafe { libc::mkdirat(fd, cstr.as_ptr(), mode.bits() as mode_t) }