#[repr(C)]pub struct SigAction {
pub handler: usize,
pub flags: usize,
pub restorer: usize,
pub mask: SigSet,
}Expand description
信号处理函数的结构体(对应 C 的 struct sigaction)
Fields§
§handler: usize信号处理函数指针,类似于 C 中的 void (*sa_handler)(int); 当信号发生时将调用此函数。也可以是特殊值,如 SIG_IGN 或 SIG_DFL。
flags: usize标志位,用于指定处理行为,如 SA_RESTART、SA_NOCLDSTOP 等。 对应 C 中的 int sa_flags;
restorer: usize系统调用的恢复函数指针,一般在使用自定义恢复机制时使用。 对应 C 中的 void (*sa_restorer)(void); 通常不使用,设为 0。
mask: SigSet一个信号集合,用于在处理该信号时阻塞的其他信号。 对应 C 中的 sigset_t sa_mask;
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SigAction
impl RefUnwindSafe for SigAction
impl Send for SigAction
impl Sync for SigAction
impl Unpin for SigAction
impl UnwindSafe for SigAction
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