Skip to main content

SignalImpl

Struct SignalImpl 

Source
pub struct SignalImpl { /* private fields */ }
Expand description

管理一个进程中的信号

Implementations§

Source§

impl SignalImpl

Source

pub fn new() -> Self

创建一个新的信号管理器。

Trait Implementations§

Source§

impl Default for SignalImpl

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Signal for SignalImpl

Source§

fn add_signal(&mut self, signal: SignalNo)

添加一个信号

Source§

fn is_handling_signal(&self) -> bool

是否当前正在处理信号

Source§

fn set_action(&mut self, signum: SignalNo, action: &SignalAction) -> bool

设置一个信号处理函数。sys_sigaction 会使用

Source§

fn get_action_ref(&self, signum: SignalNo) -> Option<SignalAction>

获取一个信号处理函数的值。sys_sigaction 会使用

Source§

fn update_mask(&mut self, mask: usize) -> usize

设置信号掩码,并获取旧的信号掩码,sys_procmask 会使用

Source§

fn from_fork(&mut self) -> Box<dyn Signal>

当 fork 一个任务时(在通常的linux syscall中,fork是某种参数形式的sys_clone), 需要继承原任务的信号处理函数和掩码。 此时 task 模块会调用此函数,根据原任务的信号模块生成新任务的信号模块
Source§

fn clear(&mut self)

sys_exec会使用。** sys_exec 不会继承信号处理函数和掩码**
Source§

fn handle_signals(&mut self, current_context: &mut LocalContext) -> SignalResult

进程执行结果,可能是直接返回用户程序或存栈或暂停或退出 Read more
Source§

fn sig_return(&mut self, current_context: &mut LocalContext) -> bool

从信号处理函数中退出,返回值表示是否成功。sys_sigreturn 会使用

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.