summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier L'Heureux <xavier.lheureux@icloud.com>2019-09-17 17:10:15 -0400
committerXavier L'Heureux <dev.xlheureux@gmail.com>2020-05-17 21:05:46 -0400
commit5229c443fe95d8dd13da6430bf942f9e57377a9d (patch)
treef86b1f9038c06e02bbe34212797e563852ed8f7b /src
parent92e63f61cd5046547c30a812cda98d8a2c3b3361 (diff)
downloadnix-5229c443fe95d8dd13da6430bf942f9e57377a9d.zip
Add wait, fdatasync, poll and pause for Redox
Diffstat (limited to 'src')
-rw-r--r--src/sys/signal.rs1
-rw-r--r--src/unistd.rs4
2 files changed, 2 insertions, 3 deletions
diff --git a/src/sys/signal.rs b/src/sys/signal.rs
index b49a9f53..811071bd 100644
--- a/src/sys/signal.rs
+++ b/src/sys/signal.rs
@@ -464,7 +464,6 @@ 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()) };
diff --git a/src/unistd.rs b/src/unistd.rs
index 53e0ecc9..f06f7232 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -505,7 +505,7 @@ pub fn mkdir<P: ?Sized + NixPath>(path: &P, mode: Mode) -> Result<()> {
/// }
/// ```
#[inline]
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(target_os = "redox"))] // RedoxFS does not support fifo yet
pub fn mkfifo<P: ?Sized + NixPath>(path: &P, mode: Mode) -> Result<()> {
let res = path.with_nix_path(|cstr| {
unsafe { libc::mkfifo(cstr.as_ptr(), mode.bits() as mode_t) }
@@ -1327,6 +1327,7 @@ pub fn fsync(fd: RawFd) -> Result<()> {
// TODO: exclude only Apple systems after https://github.com/rust-lang/libc/pull/211
#[cfg(any(target_os = "linux",
target_os = "android",
+ target_os = "redox",
target_os = "emscripten"))]
#[inline]
pub fn fdatasync(fd: RawFd) -> Result<()> {
@@ -1661,7 +1662,6 @@ pub fn initgroups(user: &CStr, group: Gid) -> Result<()> {
///
/// See also [pause(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html).
#[inline]
-#[cfg(not(target_os = "redox"))]
pub fn pause() {
unsafe { libc::pause() };
}