pub struct Process { /* private fields */ }
Expand description
A simulated process.
Implementations§
source§impl Process
impl Process
sourcepub fn borrow_as_runnable(
&self,
) -> Option<impl Deref<Target = RunnableProcess> + '_>
pub fn borrow_as_runnable( &self, ) -> Option<impl Deref<Target = RunnableProcess> + '_>
Borrows a reference to the internal RunnableProcess
if self
is runnable.
sourcepub fn borrow_as_zombie(
&self,
) -> Option<impl Deref<Target = ZombieProcess> + '_>
pub fn borrow_as_zombie( &self, ) -> Option<impl Deref<Target = ZombieProcess> + '_>
Borrows a reference to the internal ZombieProcess
if self
is a zombie.
sourcepub fn spawn(
host: &Host,
plugin_name: CString,
plugin_path: &CStr,
argv: Vec<CString>,
envv: Vec<CString>,
pause_for_debugging: bool,
strace_logging_options: Option<FmtOptions>,
expected_final_state: ProcessFinalState,
) -> Result<RootedRc<RootedRefCell<Process>>, Errno>
pub fn spawn( host: &Host, plugin_name: CString, plugin_path: &CStr, argv: Vec<CString>, envv: Vec<CString>, pause_for_debugging: bool, strace_logging_options: Option<FmtOptions>, expected_final_state: ProcessFinalState, ) -> Result<RootedRc<RootedRefCell<Process>>, Errno>
Spawn a new process. The process will be runnable via Self::resume
once it has been added to the Host
’s process list.
pub fn id(&self) -> ProcessId
pub fn parent_id(&self) -> ProcessId
pub fn set_parent_id(&self, pid: ProcessId)
pub fn group_id(&self) -> ProcessId
pub fn set_group_id(&self, id: ProcessId)
pub fn session_id(&self) -> ProcessId
pub fn set_session_id(&self, id: ProcessId)
pub fn host_id(&self) -> HostId
sourcepub fn dumpable(&self) -> SuidDump
pub fn dumpable(&self) -> SuidDump
Get process’s “dumpable” state, as manipulated by the prctl operations PR_SET_DUMPABLE
and
PR_GET_DUMPABLE
.
sourcepub fn set_dumpable(&self, val: SuidDump)
pub fn set_dumpable(&self, val: SuidDump)
Set process’s “dumpable” state, as manipulated by the prctl operations PR_SET_DUMPABLE
and
PR_GET_DUMPABLE
.
pub fn thread_group_leader_id(&self) -> ThreadId
sourcepub fn resume(&self, host: &Host, tid: ThreadId)
pub fn resume(&self, host: &Host, tid: ThreadId)
Resume execution of tid
(if it exists).
Should only be called from Host::resume
.
sourcepub fn stop(&self, host: &Host)
pub fn stop(&self, host: &Host)
Terminate the Process.
Should only be called from Host::free_all_applications
.
sourcepub fn signal(
&self,
host: &Host,
current_thread: Option<&Thread>,
siginfo_t: &siginfo_t,
)
pub fn signal( &self, host: &Host, current_thread: Option<&Thread>, siginfo_t: &siginfo_t, )
See RunnableProcess::signal
.
No-op if the self
is a ZombieProcess
.
pub fn name(&self) -> impl Deref<Target = str> + '_
pub fn plugin_name(&self) -> impl Deref<Target = str> + '_
sourcepub fn memory_borrow_mut(&self) -> impl DerefMut<Target = MemoryManager> + '_
pub fn memory_borrow_mut(&self) -> impl DerefMut<Target = MemoryManager> + '_
Deprecated wrapper for RunnableProcess::memory_borrow_mut
sourcepub fn memory_borrow(&self) -> impl Deref<Target = MemoryManager> + '_
pub fn memory_borrow(&self) -> impl Deref<Target = MemoryManager> + '_
Deprecated wrapper for RunnableProcess::memory_borrow
sourcepub fn strace_logging_options(&self) -> Option<FmtOptions>
pub fn strace_logging_options(&self) -> Option<FmtOptions>
Deprecated wrapper for RunnableProcess::strace_logging_options
sourcepub fn with_strace_file<T>(&self, f: impl FnOnce(&mut File) -> T) -> Option<T>
pub fn with_strace_file<T>(&self, f: impl FnOnce(&mut File) -> T) -> Option<T>
Deprecated wrapper for RunnableProcess::with_strace_file
sourcepub fn native_pid(&self) -> Pid
pub fn native_pid(&self) -> Pid
Deprecated wrapper for RunnableProcess::native_pid
sourcepub fn realtime_timer_borrow(&self) -> impl Deref<Target = Timer> + '_
pub fn realtime_timer_borrow(&self) -> impl Deref<Target = Timer> + '_
Deprecated wrapper for RunnableProcess::realtime_timer_borrow
sourcepub fn realtime_timer_borrow_mut(&self) -> impl DerefMut<Target = Timer> + '_
pub fn realtime_timer_borrow_mut(&self) -> impl DerefMut<Target = Timer> + '_
Deprecated wrapper for RunnableProcess::realtime_timer_borrow_mut
sourcepub fn first_live_thread_borrow(
&self,
root: &Root,
) -> Option<impl Deref<Target = RootedRc<RootedRefCell<Thread>>> + '_>
pub fn first_live_thread_borrow( &self, root: &Root, ) -> Option<impl Deref<Target = RootedRc<RootedRefCell<Thread>>> + '_>
Deprecated wrapper for RunnableProcess::first_live_thread_borrow
sourcepub fn thread_borrow(
&self,
virtual_tid: ThreadId,
) -> Option<impl Deref<Target = RootedRc<RootedRefCell<Thread>>> + '_>
pub fn thread_borrow( &self, virtual_tid: ThreadId, ) -> Option<impl Deref<Target = RootedRc<RootedRefCell<Thread>>> + '_>
Deprecated wrapper for RunnableProcess::thread_borrow
sourcepub fn free_unsafe_borrows_flush(&self) -> Result<(), Errno>
pub fn free_unsafe_borrows_flush(&self) -> Result<(), Errno>
Deprecated wrapper for RunnableProcess::free_unsafe_borrows_flush
.
sourcepub fn free_unsafe_borrows_noflush(&self)
pub fn free_unsafe_borrows_noflush(&self)
Deprecated wrapper for RunnableProcess::free_unsafe_borrows_noflush
.
pub fn physical_address( &self, vptr: ForeignPtr<()>, ) -> ManagedPhysicalMemoryAddr
pub fn is_running(&self) -> bool
sourcepub fn add_thread(&self, host: &Host, thread: RootedRc<RootedRefCell<Thread>>)
pub fn add_thread(&self, host: &Host, thread: RootedRc<RootedRefCell<Thread>>)
Deprecated wrapper for RunnableProcess::add_thread
sourcepub fn shmem(
&self,
) -> impl Deref<Target = ShMemBlock<'static, ProcessShmem>> + '_
pub fn shmem( &self, ) -> impl Deref<Target = ShMemBlock<'static, ProcessShmem>> + '_
Deprecated wrapper for RunnableProcess::shmem
sourcepub fn exit_signal(&self) -> Option<Signal>
pub fn exit_signal(&self) -> Option<Signal>
Signal that will be sent to parent process on exit. Typically Some(SIGCHLD)
.
pub fn current_working_dir(&self) -> impl Deref<Target = CString> + '_
sourcepub fn set_current_working_dir(&self, path: CString)
pub fn set_current_working_dir(&self, path: CString)
Set the process’s working directory. This must be kept in sync with the actual working dir of the native process. See https://github.com/shadow/shadow/issues/2960
sourcepub fn update_for_exec(
&mut self,
host: &Host,
tid: ThreadId,
mthread: ManagedThread,
)
pub fn update_for_exec( &mut self, host: &Host, tid: ThreadId, mthread: ManagedThread, )
Update self
to complete an exec
syscall from thread tid
, replacing
the running managed process with mthread
.
Trait Implementations§
source§impl ExplicitDrop for Process
impl ExplicitDrop for Process
type ExplicitDropParam = Host
type ExplicitDropResult = ()
fn explicit_drop( self, host: &Self::ExplicitDropParam, ) -> Self::ExplicitDropResult
Auto Trait Implementations§
impl !Freeze for Process
impl !RefUnwindSafe for Process
impl Send for Process
impl !Sync for Process
impl Unpin for Process
impl !UnwindSafe for Process
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> 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