pub struct SignalFd {
signalfd: File,
signal: c_int,
}
Expand description
A safe wrapper around a Linux signalfd (man 2 signalfd).
A signalfd can be used for non-synchronous signals (such as SIGCHLD) so that signals can be processed without the use of a signal handler.
Fields§
§signalfd: File
§signal: c_int
Implementations§
source§impl SignalFd
impl SignalFd
sourcepub fn new(signal: c_int) -> Result<SignalFd, Error>
pub fn new(signal: c_int) -> Result<SignalFd, Error>
Creates a new SignalFd for the given signal, blocking the normal handler for the signal as well. Since we mask out the normal handler, this is a risky operation - signal masking will persist across fork and even exec so the user of SignalFd should think long and hard about when to mask signals.
Trait Implementations§
source§impl AsRawDescriptor for SignalFd
impl AsRawDescriptor for SignalFd
source§fn as_raw_descriptor(&self) -> RawDescriptor
fn as_raw_descriptor(&self) -> RawDescriptor
Returns the underlying raw descriptor. Read more
Auto Trait Implementations§
impl RefUnwindSafe for SignalFd
impl Send for SignalFd
impl Sync for SignalFd
impl Unpin for SignalFd
impl UnwindSafe for SignalFd
Blanket Implementations§
source§impl<T> AsRawDescriptors for Twhere
T: AsRawDescriptor,
impl<T> AsRawDescriptors for Twhere
T: AsRawDescriptor,
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