Struct base::SignalFd

source ·
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§

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.

Read a siginfo struct from the signalfd, if available.

Trait Implementations§

Returns the underlying raw descriptor. Read more
Extracts the raw file descriptor. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Returns the underlying raw descriptors. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.