From dbcf7923b770394fdec8d9bb4bc8e3daef65e5ba Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Thu, 5 May 2016 18:44:38 +0200 Subject: [PATCH] Provide accessors to sigmask of UContext. --- src/ucontext.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ucontext.rs b/src/ucontext.rs index ce4e489f5b..89c8cae26c 100644 --- a/src/ucontext.rs +++ b/src/ucontext.rs @@ -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 { @@ -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) } + } }