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 prlimit64(
    &self,
    resource: Resource,
    new_rlim: Option<&rlimit64>,
    old_rlim: Option<&mut rlimit64>,
) -> Result<(), Errno>
 
pub fn prlimit64( &self, resource: Resource, new_rlim: Option<&rlimit64>, old_rlim: Option<&mut rlimit64>, ) -> Result<(), Errno>
Emulate the prlimit64 syscall for this process, operating on potentially both
native and emulated resource limits.
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