Skip to content

Commit

Permalink
Auto merge of #370 - fiveop:context, r=posborne
Browse files Browse the repository at this point in the history
Provide accessors to sigmask of UContext.
  • Loading branch information
homu committed Jun 27, 2016
2 parents e1ad0a3 + dbcf792 commit 9c6c71a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ucontext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use libc;
use {Errno, Result};
#[cfg(not(target_env = "musl"))]
use std::mem;
use sys::signal::SigSet;

#[derive(Clone, Copy)]
pub struct UContext {
Expand All @@ -26,4 +27,12 @@ impl UContext {
};
Errno::result(res).map(drop)
}

pub fn sigmask_mut(&mut self) -> &mut SigSet {
unsafe { mem::transmute(&mut self.context.uc_sigmask) }
}

pub fn sigmask(&self) -> &SigSet {
unsafe { mem::transmute(&self.context.uc_sigmask) }
}
}

0 comments on commit 9c6c71a

Please sign in to comment.