pub struct SignalRuntime;Expand description
Utilities for process signal management.
Implementations§
Source§impl SignalRuntime
impl SignalRuntime
Sourcepub fn set_with(signals: &[i32]) -> Result<SignalSet, CoreError>
pub fn set_with(signals: &[i32]) -> Result<SignalSet, CoreError>
Create a signal set containing the specified signals.
§Errors
EINVAL: One of the signal numbers is invalid.
Sourcepub fn block_current_thread(signals: &SignalSet) -> Result<SignalSet, CoreError>
pub fn block_current_thread(signals: &SignalSet) -> Result<SignalSet, CoreError>
Block the specified signals for the current thread and return the previous mask.
§Errors
EINVAL:howorsignalsis invalid.
Sourcepub fn wait(signals: &SignalSet) -> Result<i32, CoreError>
pub fn wait(signals: &SignalSet) -> Result<i32, CoreError>
Wait synchronously for one of the supplied signals.
§Errors
EINVAL:signalscontains invalid signal numbers.
Sourcepub fn interrupt_thread(thread: ThreadId, signal: i32) -> Result<(), CoreError>
pub fn interrupt_thread(thread: ThreadId, signal: i32) -> Result<(), CoreError>
Deliver a signal to a specific thread.
§Errors
EINVAL: Invalid signal number.ESRCH: The thread ID is invalid or the thread has terminated.
Sourcepub fn set_current_thread_mask(
how: i32,
signals: &SignalSet,
) -> Result<SignalSet, CoreError>
pub fn set_current_thread_mask( how: i32, signals: &SignalSet, ) -> Result<SignalSet, CoreError>
Block or unblock signals for the current thread and return the previous mask.
Sourcepub fn unblock_all() -> Result<(), CoreError>
pub fn unblock_all() -> Result<(), CoreError>
Unblock all signals for the current thread.
Sourcepub fn signalfd_new(signals: &SignalSet) -> Result<Fd, CoreError>
pub fn signalfd_new(signals: &SignalSet) -> Result<Fd, CoreError>
Create a new signalfd for the specified signal set.
The descriptor is created with SFD_CLOEXEC and SFD_NONBLOCK set.
Callers are responsible for blocking the signals in the set before
reading from the signalfd.
§Fork Safety
The descriptor is O_CLOEXEC and will be closed in the child after exec.
§Errors
EINVAL:signalsis invalid.EMFILE: Process limit on open file descriptors hit.ENFILE: System-wide limit on open files hit.
Auto Trait Implementations§
impl Freeze for SignalRuntime
impl RefUnwindSafe for SignalRuntime
impl Send for SignalRuntime
impl Sync for SignalRuntime
impl Unpin for SignalRuntime
impl UnsafeUnpin for SignalRuntime
impl UnwindSafe for SignalRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more