pub struct Guard<'a, B, G> {
pub base: &'a B,
/* private fields */
}Fields§
§base: &'a BImplementations§
Source§impl<'guard, G: 'guard + Deref<Target = TerminalMutableState>> Guard<'guard, Terminal, G>
impl<'guard, G: 'guard + Deref<Target = TerminalMutableState>> Guard<'guard, Terminal, G>
Sourcepub fn get_available_read_size(&self, is_main: bool) -> usize
pub fn get_available_read_size(&self, is_main: bool) -> usize
Returns the number of available bytes to read from the side of the terminal described by
is_main.
pub fn is_main_closed(&self) -> bool
Source§impl<'guard, G: 'guard + DerefMut<Target = TerminalMutableState>> Guard<'guard, Terminal, G>
impl<'guard, G: 'guard + DerefMut<Target = TerminalMutableState>> Guard<'guard, Terminal, G>
Sourcepub fn main_close(&mut self)
pub fn main_close(&mut self)
close implementation of the main side of the terminal.
Sourcepub fn main_open(&mut self)
pub fn main_open(&mut self)
Called when a new reference to the main side of this terminal is made.
Sourcepub fn replica_close(&mut self)
pub fn replica_close(&mut self)
close implementation of the replica side of the terminal.
Sourcepub fn replica_open(&mut self)
pub fn replica_open(&mut self)
Called when a new reference to the replica side of this terminal is made.
Source§impl<'a, B, S> Guard<'a, B, MutexGuard<'a, S>>
impl<'a, B, S> Guard<'a, B, MutexGuard<'a, S>>
Source§impl<'guard, B, S, G: 'guard + DerefMut<Target = S>> Guard<'guard, B, G>
impl<'guard, B, S, G: 'guard + DerefMut<Target = S>> Guard<'guard, B, G>
pub fn as_mut(&mut self) -> StateMutRef<'_, B, S>
Source§impl<'guard, G: 'guard + Deref<Target = ProcessGroupMutableState>> Guard<'guard, ProcessGroup, G>
impl<'guard, G: 'guard + Deref<Target = ProcessGroupMutableState>> Guard<'guard, ProcessGroup, G>
pub fn thread_groups(&self) -> Box<dyn Iterator<Item = Arc<ThreadGroup>> + '_>
Source§impl<'guard, G: 'guard + Deref<Target = SessionMutableState>> Guard<'guard, Session, G>
impl<'guard, G: 'guard + Deref<Target = SessionMutableState>> Guard<'guard, Session, G>
pub fn get_foreground_process_group_leader(&self) -> pid_t
pub fn get_foreground_process_group(&self) -> Option<Arc<ProcessGroup>>
Source§impl<'guard, G: 'guard + DerefMut<Target = SessionMutableState>> Guard<'guard, Session, G>
impl<'guard, G: 'guard + DerefMut<Target = SessionMutableState>> Guard<'guard, Session, G>
Sourcepub fn remove(&mut self, pid: pid_t)
pub fn remove(&mut self, pid: pid_t)
Removes the process group from the session. Returns whether the session is empty.
pub fn insert(&mut self, process_group: &Arc<ProcessGroup>)
pub fn set_foreground_process_group( &mut self, process_group: &Arc<ProcessGroup>, )
Source§impl<'guard, G: 'guard + Deref<Target = TaskMutableState>> Guard<'guard, Task, G>
impl<'guard, G: 'guard + Deref<Target = TaskMutableState>> Guard<'guard, Task, G>
Sourcepub fn pending_signal_count(&self) -> usize
pub fn pending_signal_count(&self) -> usize
Returns the number of pending signals for this task, without considering the signal mask.
Sourcepub fn has_signal_pending(&self, signal: Signal) -> bool
pub fn has_signal_pending(&self, signal: Signal) -> bool
Returns true if signal is pending for this task, without considering the signal mask.
Sourcepub fn pending_signals(&self) -> SigSet
pub fn pending_signals(&self) -> SigSet
The set of pending signals for the task, including the signals pending for the thread group.
Sourcepub fn task_specific_pending_signals(&self) -> SigSet
pub fn task_specific_pending_signals(&self) -> SigSet
The set of pending signals for the task specifically, not including the signals pending for the thread group.
Sourcepub fn is_any_signal_allowed_by_mask(&self, mask: SigSet) -> bool
pub fn is_any_signal_allowed_by_mask(&self, mask: SigSet) -> bool
Returns true if any currently pending signal is allowed by mask.
Sourcepub fn is_any_signal_pending(&self) -> bool
pub fn is_any_signal_pending(&self) -> bool
Returns whether or not a signal is pending for this task, taking the current signal mask into account.
Source§impl<'guard, G: 'guard + DerefMut<Target = TaskMutableState>> Guard<'guard, Task, G>
impl<'guard, G: 'guard + DerefMut<Target = TaskMutableState>> Guard<'guard, Task, G>
pub fn set_stopped( &mut self, stopped: StopState, siginfo: Option<SignalInfo>, current_task: Option<&CurrentTask>, event: Option<PtraceEventData>, )
pub fn set_ptrace( &mut self, tracer: Option<Box<PtraceState>>, ) -> Result<(), Errno>
pub fn can_accept_ptrace_commands(&mut self) -> bool
pub fn update_flags(&mut self, clear: TaskFlags, set: TaskFlags)
pub fn set_flags(&mut self, flag: TaskFlags, v: bool)
pub fn set_exit_status(&mut self, status: ExitStatus)
pub fn set_exit_status_if_not_already(&mut self, status: ExitStatus)
Sourcepub fn take_specific_signal(
&mut self,
siginfo: SignalInfo,
) -> Option<SignalInfo>
pub fn take_specific_signal( &mut self, siginfo: SignalInfo, ) -> Option<SignalInfo>
Removes and returns the next pending signal for this task.
Returns None if siginfo is a blocked signal, or no such signal is pending.
Sourcepub fn take_any_signal(&mut self) -> Option<SignalInfo>
pub fn take_any_signal(&mut self) -> Option<SignalInfo>
Removes and returns a pending signal that is unblocked by the current signal mask.
Returns None if there are no unblocked signals pending.
Sourcepub fn take_signal_with_mask(
&mut self,
signal_mask: SigSet,
) -> Option<SignalInfo>
pub fn take_signal_with_mask( &mut self, signal_mask: SigSet, ) -> Option<SignalInfo>
Removes and returns a pending signal that is unblocked by signal_mask.
Returns None if there are no signals pending that are unblocked by signal_mask.
Sourcepub fn take_kernel_signal(&mut self) -> Option<KernelSignal>
pub fn take_kernel_signal(&mut self) -> Option<KernelSignal>
Removes and returns a pending internal signal.
Returns None if there are no signals pending.
Source§impl<'guard, G: 'guard + Deref<Target = ThreadGroupMutableState>> Guard<'guard, ThreadGroup, G>
impl<'guard, G: 'guard + Deref<Target = ThreadGroupMutableState>> Guard<'guard, ThreadGroup, G>
pub fn leader(&self) -> pid_t
pub fn leader_command(&self) -> TaskCommand
pub fn is_terminating(&self) -> bool
pub fn children(&self) -> impl Iterator<Item = Arc<ThreadGroup>> + '_
pub fn tasks(&self) -> impl Iterator<Item = TempRef<'_, Task>> + '_
pub fn task_ids(&self) -> impl Iterator<Item = &tid_t>
pub fn contains_task(&self, tid: tid_t) -> bool
pub fn get_task(&self, tid: tid_t) -> Option<TempRef<'_, Task>>
pub fn tasks_count(&self) -> usize
pub fn get_ppid(&self) -> pid_t
Sourcepub fn is_waitable(&self) -> bool
pub fn is_waitable(&self) -> bool
Indicates whether the thread group is waitable via waitid and waitpid for either WSTOPPED or WCONTINUED.
pub fn is_correct_exit_signal( for_clone: bool, exit_code: Option<Signal>, ) -> bool
Source§impl<'guard, G: 'guard + DerefMut<Target = ThreadGroupMutableState>> Guard<'guard, ThreadGroup, G>
impl<'guard, G: 'guard + DerefMut<Target = ThreadGroupMutableState>> Guard<'guard, ThreadGroup, G>
pub fn get_waitable_zombie( &mut self, zombie_list: &dyn Fn(&mut ThreadGroupMutableState) -> &mut Vec<OwnedRef<ZombieProcess>>, selector: &ProcessSelector, options: &WaitingOptions, pids: &mut PidTable, ) -> Option<WaitResult>
Sourcepub fn get_waitable_child(
&mut self,
selector: &ProcessSelector,
options: &WaitingOptions,
pids: &mut PidTable,
) -> WaitableChildResult
pub fn get_waitable_child( &mut self, selector: &ProcessSelector, options: &WaitingOptions, pids: &mut PidTable, ) -> WaitableChildResult
Returns any waitable child matching the given selector and options. Returns None if no
child matching the selector is waitable. Returns ECHILD if no child matches the selector at
all.
Will remove the waitable status from the child depending on options.
Sourcepub fn set_stopped(
self,
new_stopped: StopState,
siginfo: Option<SignalInfo>,
finalize_only: bool,
) -> StopState
pub fn set_stopped( self, new_stopped: StopState, siginfo: Option<SignalInfo>, finalize_only: bool, ) -> StopState
Set the stop status of the process. If you pass |siginfo| of |None|, does not update the signal. If |finalize_only| is set, will check that the set will be a finalize (Stopping -> Stopped or Stopped -> Stopped) before executing it.
Returns the latest stop state after any changes.
Sourcepub fn send_signal(self, signal_info: SignalInfo)
pub fn send_signal(self, signal_info: SignalInfo)
Sends the signal signal_info to this thread group.
Source§impl<'guard, G: 'guard + Deref<Target = DirEntryState>> Guard<'guard, DirEntry, G>
impl<'guard, G: 'guard + Deref<Target = DirEntryState>> Guard<'guard, DirEntry, G>
pub fn local_name(&self) -> &FsStr
pub fn parent(&self) -> &Option<DirEntryHandle>
Source§impl<'guard, G: 'guard + Deref<Target = MountState>> Guard<'guard, Arc<Mount>, G>
impl<'guard, G: 'guard + Deref<Target = MountState>> Guard<'guard, Arc<Mount>, G>
Is the mount in a peer group? Corresponds to MS_SHARED.
Source§impl<'guard, G: 'guard + DerefMut<Target = MountState>> Guard<'guard, Arc<Mount>, G>
impl<'guard, G: 'guard + DerefMut<Target = MountState>> Guard<'guard, Arc<Mount>, G>
Put the mount in a peer group. Implements MS_SHARED.
Sourcepub fn make_private(&mut self)
pub fn make_private(&mut self)
Take the mount out of its peer group, also remove upstream if any. Implements MS_PRIVATE.
Sourcepub fn make_downstream(&mut self)
pub fn make_downstream(&mut self)
Take the mount out of its peer group and make it downstream instead. Implements MountFlags::DOWNSTREAM (MS_SLAVE).
Trait Implementations§
Auto Trait Implementations§
impl<'a, B, G> Freeze for Guard<'a, B, G>where
G: Freeze,
impl<'a, B, G> RefUnwindSafe for Guard<'a, B, G>where
G: RefUnwindSafe,
B: RefUnwindSafe,
impl<'a, B, G> Send for Guard<'a, B, G>
impl<'a, B, G> Sync for Guard<'a, B, G>
impl<'a, B, G> Unpin for Guard<'a, B, G>where
G: Unpin,
impl<'a, B, G> UnwindSafe for Guard<'a, B, G>where
G: UnwindSafe,
B: RefUnwindSafe,
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,
Source§impl<T, P> FileOps for P
impl<T, P> FileOps for P
Source§fn close(
self: Box<P>,
_locked: &mut Locked<FileOpsCore>,
_file: &FileObjectState,
_current_task: &CurrentTask,
)
fn close( self: Box<P>, _locked: &mut Locked<FileOpsCore>, _file: &FileObjectState, _current_task: &CurrentTask, )
Source§fn flush(
&self,
locked: &mut Locked<FileOpsCore>,
file: &FileObject,
current_task: &CurrentTask,
)
fn flush( &self, locked: &mut Locked<FileOpsCore>, file: &FileObject, current_task: &CurrentTask, )
Source§fn has_persistent_offsets(&self) -> bool
fn has_persistent_offsets(&self) -> bool
false is only
optimization and will makes FileObject never hold the offset lock when calling read and
write.Source§fn writes_update_seek_offset(&self) -> bool
fn writes_update_seek_offset(&self) -> bool
write() operations on the file will update the seek offset.Source§fn is_seekable(&self) -> bool
fn is_seekable(&self) -> bool
Source§fn read(
&self,
locked: &mut Locked<FileOpsCore>,
file: &FileObject,
current_task: &CurrentTask,
offset: usize,
data: &mut dyn OutputBuffer,
) -> Result<usize, Errno>
fn read( &self, locked: &mut Locked<FileOpsCore>, file: &FileObject, current_task: &CurrentTask, offset: usize, data: &mut dyn OutputBuffer, ) -> Result<usize, Errno>
Source§fn write(
&self,
locked: &mut Locked<FileOpsCore>,
file: &FileObject,
current_task: &CurrentTask,
offset: usize,
data: &mut dyn InputBuffer,
) -> Result<usize, Errno>
fn write( &self, locked: &mut Locked<FileOpsCore>, file: &FileObject, current_task: &CurrentTask, offset: usize, data: &mut dyn InputBuffer, ) -> Result<usize, Errno>
Source§fn seek(
&self,
locked: &mut Locked<FileOpsCore>,
file: &FileObject,
current_task: &CurrentTask,
current_offset: i64,
target: SeekTarget,
) -> Result<i64, Errno>
fn seek( &self, locked: &mut Locked<FileOpsCore>, file: &FileObject, current_task: &CurrentTask, current_offset: i64, target: SeekTarget, ) -> Result<i64, Errno>
current_offset if the file is seekable.Source§fn sync(
&self,
file: &FileObject,
current_task: &CurrentTask,
) -> Result<(), Errno>
fn sync( &self, file: &FileObject, current_task: &CurrentTask, ) -> Result<(), Errno>
Source§fn data_sync(
&self,
file: &FileObject,
current_task: &CurrentTask,
) -> Result<(), Errno>
fn data_sync( &self, file: &FileObject, current_task: &CurrentTask, ) -> Result<(), Errno>
Source§fn get_memory(
&self,
locked: &mut Locked<FileOpsCore>,
file: &FileObject,
current_task: &CurrentTask,
length: Option<usize>,
prot: ProtectionFlags,
) -> Result<Arc<MemoryObject>, Errno>
fn get_memory( &self, locked: &mut Locked<FileOpsCore>, file: &FileObject, current_task: &CurrentTask, length: Option<usize>, prot: ProtectionFlags, ) -> Result<Arc<MemoryObject>, Errno>
length is a hint for the desired size of the VMO. The returned VMO may be larger or
smaller than the requested length.
This method is typically called by Self::mmap.Source§fn mmap(
&self,
locked: &mut Locked<FileOpsCore>,
file: &FileObject,
current_task: &CurrentTask,
addr: DesiredAddress,
memory_offset: u64,
length: usize,
prot_flags: ProtectionFlags,
options: MappingOptions,
filename: NamespaceNode,
) -> Result<UserAddress, Errno>
fn mmap( &self, locked: &mut Locked<FileOpsCore>, file: &FileObject, current_task: &CurrentTask, addr: DesiredAddress, memory_offset: u64, length: usize, prot_flags: ProtectionFlags, options: MappingOptions, filename: NamespaceNode, ) -> Result<UserAddress, Errno>
Self::get_memory to get a VMO
and then maps it with [crate::mm::MemoryManager::map].
Only implement this trait method if your file needs to control mapping, or record where
a VMO gets mapped.Source§fn readdir(
&self,
locked: &mut Locked<FileOpsCore>,
file: &FileObject,
current_task: &CurrentTask,
sink: &mut dyn DirentSink,
) -> Result<(), Errno>
fn readdir( &self, locked: &mut Locked<FileOpsCore>, file: &FileObject, current_task: &CurrentTask, sink: &mut dyn DirentSink, ) -> Result<(), Errno>
Source§fn wait_async(
&self,
locked: &mut Locked<FileOpsCore>,
file: &FileObject,
current_task: &CurrentTask,
waiter: &Waiter,
events: FdEvents,
handler: EventHandler,
) -> Option<WaitCanceler>
fn wait_async( &self, locked: &mut Locked<FileOpsCore>, file: &FileObject, current_task: &CurrentTask, waiter: &Waiter, events: FdEvents, handler: EventHandler, ) -> Option<WaitCanceler>
None if this file does not support blocking waits. Read moreSource§fn query_events(
&self,
locked: &mut Locked<FileOpsCore>,
file: &FileObject,
current_task: &CurrentTask,
) -> Result<FdEvents, Errno>
fn query_events( &self, locked: &mut Locked<FileOpsCore>, file: &FileObject, current_task: &CurrentTask, ) -> Result<FdEvents, Errno>
fn ioctl( &self, locked: &mut Locked<Unlocked>, file: &FileObject, current_task: &CurrentTask, request: u32, arg: SyscallArg, ) -> Result<SyscallResult, Errno>
fn fcntl( &self, file: &FileObject, current_task: &CurrentTask, cmd: u32, arg: u64, ) -> Result<SyscallResult, Errno>
Source§fn to_handle(
&self,
file: &FileObject,
current_task: &CurrentTask,
) -> Result<Option<NullableHandle>, Errno>
fn to_handle( &self, file: &FileObject, current_task: &CurrentTask, ) -> Result<Option<NullableHandle>, Errno>
Source§fn as_thread_group_key(
&self,
file: &FileObject,
) -> Result<ThreadGroupKey, Errno>
fn as_thread_group_key( &self, file: &FileObject, ) -> Result<ThreadGroupKey, Errno>
fn readahead( &self, file: &FileObject, current_task: &CurrentTask, offset: usize, length: usize, ) -> Result<(), Errno>
Source§fn extra_fdinfo(
&self,
locked: &mut Locked<FileOpsCore>,
file: &Arc<ObjectReleaser<FileObject, FileObjectReleaserAction>>,
current_task: &CurrentTask,
) -> Option<BString>
fn extra_fdinfo( &self, locked: &mut Locked<FileOpsCore>, file: &Arc<ObjectReleaser<FileObject, FileObjectReleaserAction>>, current_task: &CurrentTask, ) -> Option<BString>
Source§fn open(
&self,
_locked: &mut Locked<FileOpsCore>,
_file: &FileObject,
_current_task: &CurrentTask,
) -> Result<(), Errno>
fn open( &self, _locked: &mut Locked<FileOpsCore>, _file: &FileObject, _current_task: &CurrentTask, ) -> Result<(), Errno>
§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 moreSource§impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Source§fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
random to avoid conflict with the new gen keyword in Rust 2024.Rng::random.Source§fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
random_rangeRng::random_range.§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§type Error = Infallible
type Error = Infallible
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
UnwrapMut wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
RngCore to a RngReadAdapter.