pub struct TaskMutableState {
pub clear_child_tid: UserRef<tid_t>,
pub scheduler_state: SchedulerState,
pub uts_ns: UtsNamespaceHandle,
pub oom_score_adj: i32,
pub seccomp_filters: SeccompFilterContainer,
pub robust_list_head: RobustListHeadPtr,
pub timerslack_ns: u64,
pub default_timerslack_ns: u64,
pub ptrace: Option<Box<PtraceState>>,
pub captured_thread_state: Option<Box<CapturedThreadState>>,
/* private fields */
}Fields§
§clear_child_tid: UserRef<tid_t>§scheduler_state: SchedulerStateDesired scheduler state for the task.
uts_ns: UtsNamespaceHandleThe UTS namespace assigned to this thread.
This field is kept in the mutable state because the UTS namespace of a thread
can be forked using clone() or unshare() syscalls.
We use UtsNamespaceHandle because the UTS properties can be modified by any other thread that shares this namespace.
oom_score_adj: i32Userspace hint about how to adjust the OOM score for this process.
seccomp_filters: SeccompFilterContainerList of currently installed seccomp_filters
robust_list_head: RobustListHeadPtrA pointer to the head of the robust futex list of this thread in userspace. See get_robust_list(2)
timerslack_ns: u64The timer slack used to group timer expirations for the calling thread.
Timers may expire up to timerslack_ns late, but never early.
If this value is 0, the task’s default timerslack is used.
default_timerslack_ns: u64The default value for timerslack_ns. This value cannot change during the lifetime of a
task.
This value is set to the timerslack_ns of the creating thread, and thus is not constant
across tasks.
ptrace: Option<Box<PtraceState>>Information that a tracer needs to communicate with this process, if it is being traced.
captured_thread_state: Option<Box<CapturedThreadState>>Information that a tracer needs to inspect this process.
Implementations§
Source§impl TaskMutableState
impl TaskMutableState
pub fn no_new_privs(&self) -> bool
Sourcepub fn enable_no_new_privs(&mut self)
pub fn enable_no_new_privs(&mut self)
Sets the value of no_new_privs to true. It is an error to set it to anything else.
pub fn get_timerslack<T: Timeline>(&self) -> Duration<T>
Sourcepub fn set_timerslack_ns(&mut self, ns: u64)
pub fn set_timerslack_ns(&mut self, ns: u64)
Sets the current timerslack of the task to ns.
If ns is zero, the current timerslack gets reset to the task’s default timerslack.
pub fn is_ptraced(&self) -> bool
pub fn is_ptrace_listening(&self) -> bool
pub fn ptrace_on_signal_consume(&mut self) -> bool
pub fn notify_ptracers(&mut self)
pub fn wait_on_ptracer(&self, waiter: &Waiter)
pub fn notify_ptracees(&mut self)
pub fn take_captured_state(&mut self) -> Option<Box<CapturedThreadState>>
pub fn copy_state_from(&mut self, current_task: &CurrentTask)
Sourcepub fn signal_mask(&self) -> SigSet
pub fn signal_mask(&self) -> SigSet
Returns the task’s currently active signal mask.
Sourcepub fn is_signal_masked(&self, signal: Signal) -> bool
pub fn is_signal_masked(&self, signal: Signal) -> bool
Returns true if signal is currently blocked by this task’s signal mask.
Sourcepub fn is_signal_masked_by_saved_mask(&self, signal: Signal) -> bool
pub fn is_signal_masked_by_saved_mask(&self, signal: Signal) -> bool
Returns true if signal is blocked by the saved signal mask.
Note that the current signal mask may still not be blocking the signal.
Sourcepub fn enqueue_kernel_signal(&mut self, signal: KernelSignal)
pub fn enqueue_kernel_signal(&mut self, signal: KernelSignal)
Enqueues an internal signal at the back of the task’s kernel signal queue.
Sourcepub fn enqueue_signal(&mut self, signal: SignalInfo)
pub fn enqueue_signal(&mut self, signal: SignalInfo)
Enqueues a signal at the back of the task’s signal queue.
Sourcepub fn enqueue_signal_front(&mut self, signal: SignalInfo)
pub fn enqueue_signal_front(&mut self, signal: SignalInfo)
Enqueues the signal, allowing the signal to skip straight to the front of the task’s queue.
enqueue_signal is the more common API to use.
Note that this will not guarantee that the signal is dequeued before any process-directed signals.
Sourcepub fn set_signal_mask(&mut self, mask: SigSet)
pub fn set_signal_mask(&mut self, mask: SigSet)
Sets the current signal mask of the task.
Sourcepub fn set_temporary_signal_mask(&mut self, mask: SigSet)
pub fn set_temporary_signal_mask(&mut self, mask: SigSet)
Sets a temporary signal mask for the task.
This mask should be removed by a matching call to restore_signal_mask.
Sourcepub fn restore_signal_mask(&mut self)
pub fn restore_signal_mask(&mut self)
Removes the currently active, temporary, signal mask and restores the previously active signal mask.
Sourcepub fn is_blocked(&self) -> bool
pub fn is_blocked(&self) -> bool
Returns true if the task’s current RunState is blocked.
Sourcepub fn set_run_state(&mut self, run_state: RunState)
pub fn set_run_state(&mut self, run_state: RunState)
Sets the task’s RunState to run_state.
pub fn run_state(&self) -> RunState
pub fn on_signal_stack(&self, stack_pointer_register: u64) -> bool
pub fn set_sigaltstack(&mut self, stack: Option<sigaltstack>)
pub fn sigaltstack(&self) -> Option<sigaltstack>
pub fn wait_on_signal(&mut self, waiter: &Waiter)
pub fn signals_mut(&mut self) -> &mut SignalState
pub fn wait_on_signal_fd_events( &self, waiter: &Waiter, mask: SigSet, handler: EventHandler, ) -> WaitCanceler
pub fn notify_signal_waiters(&self, signal: &Signal)
pub fn is_frozen(&self) -> bool
Auto Trait Implementations§
impl Freeze for TaskMutableState
impl !RefUnwindSafe for TaskMutableState
impl Send for TaskMutableState
impl Sync for TaskMutableState
impl Unpin for TaskMutableState
impl !UnwindSafe for TaskMutableState
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more