Skip to content

Commit 9c6c71a

Browse files
committed
Auto merge of #370 - fiveop:context, r=posborne
Provide accessors to sigmask of UContext.
2 parents e1ad0a3 + dbcf792 commit 9c6c71a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ucontext.rs

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use libc;
33
use {Errno, Result};
44
#[cfg(not(target_env = "musl"))]
55
use std::mem;
6+
use sys::signal::SigSet;
67

78
#[derive(Clone, Copy)]
89
pub struct UContext {
@@ -26,4 +27,12 @@ impl UContext {
2627
};
2728
Errno::result(res).map(drop)
2829
}
30+
31+
pub fn sigmask_mut(&mut self) -> &mut SigSet {
32+
unsafe { mem::transmute(&mut self.context.uc_sigmask) }
33+
}
34+
35+
pub fn sigmask(&self) -> &SigSet {
36+
unsafe { mem::transmute(&self.context.uc_sigmask) }
37+
}
2938
}

0 commit comments

Comments
 (0)