summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/mod.rs4
-rw-r--r--src/sys/signalfd.rs10
2 files changed, 5 insertions, 9 deletions
diff --git a/src/sys/mod.rs b/src/sys/mod.rs
index 796a00a1..9636f93d 100644
--- a/src/sys/mod.rs
+++ b/src/sys/mod.rs
@@ -23,8 +23,8 @@ pub mod sendfile;
pub mod signal;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-#[cfg(feature = "signalfd")]
+// FIXME: Add to Android once libc#671 lands in a release
+#[cfg(target_os = "linux")]
pub mod signalfd;
pub mod socket;
diff --git a/src/sys/signalfd.rs b/src/sys/signalfd.rs
index a3dfb6be..fcf2efa9 100644
--- a/src/sys/signalfd.rs
+++ b/src/sys/signalfd.rs
@@ -60,12 +60,10 @@ pub fn signalfd(fd: RawFd, mask: &SigSet, flags: SfdFlags) -> Result<RawFd> {
/// # Examples
///
/// ```
-/// use nix::sys::signalfd::*;
-///
+/// # use nix::sys::signalfd::*;
+/// // Set the thread to block the SIGUSR1 signal, otherwise the default handler will be used
/// let mut mask = SigSet::empty();
-/// mask.add(signal::SIGUSR1).unwrap();
-///
-/// // Block the signal, otherwise the default handler will be invoked instead.
+/// mask.add(signal::SIGUSR1);
/// mask.thread_block().unwrap();
///
/// // Signals are queued up on the file descriptor
@@ -74,11 +72,9 @@ pub fn signalfd(fd: RawFd, mask: &SigSet, flags: SfdFlags) -> Result<RawFd> {
/// match sfd.read_signal() {
/// // we caught a signal
/// Ok(Some(sig)) => (),
-///
/// // there were no signals waiting (only happens when the SFD_NONBLOCK flag is set,
/// // otherwise the read_signal call blocks)
/// Ok(None) => (),
-///
/// Err(err) => (), // some error happend
/// }
/// ```