pub struct Process(/* private fields */);
Expand description
An object representing a Zircon process.
As essentially a subtype of Handle
, it can be freely interconverted.
Implementations§
Source§impl Process
impl Process
Sourcepub fn start(
&self,
thread: &Thread,
entry: usize,
stack: usize,
arg1: Handle,
arg2: usize,
) -> Result<(), Status>
pub fn start( &self, thread: &Thread, entry: usize, stack: usize, arg1: Handle, arg2: usize, ) -> Result<(), Status>
Similar to Thread::start
, but is used to start the first thread in a process.
Wraps the zx_process_start syscall.
Sourcepub fn create_thread(&self, name: &[u8]) -> Result<Thread, Status>
pub fn create_thread(&self, name: &[u8]) -> Result<Thread, Status>
Create a thread inside a process.
Wraps the zx_thread_create syscall.
Sourcepub fn write_memory(&self, vaddr: usize, bytes: &[u8]) -> Result<usize, Status>
pub fn write_memory(&self, vaddr: usize, bytes: &[u8]) -> Result<usize, Status>
Write memory inside a process.
Wraps the zx_process_write_memory syscall.
Sourcepub fn read_memory(
&self,
vaddr: usize,
bytes: &mut [u8],
) -> Result<usize, Status>
pub fn read_memory( &self, vaddr: usize, bytes: &mut [u8], ) -> Result<usize, Status>
Read memory from inside a process.
Wraps the zx_process_read_memory syscall.
Sourcepub fn read_memory_uninit<'a>(
&self,
vaddr: usize,
buffer: &'a mut [MaybeUninit<u8>],
) -> Result<(&'a mut [u8], &'a mut [MaybeUninit<u8>]), Status>
pub fn read_memory_uninit<'a>( &self, vaddr: usize, buffer: &'a mut [MaybeUninit<u8>], ) -> Result<(&'a mut [u8], &'a mut [MaybeUninit<u8>]), Status>
Read memory from inside a process without requiring the output buffer to be initialized.
Wraps the zx_process_read_memory syscall.
Sourcepub fn info(&self) -> Result<ProcessInfo, Status>
pub fn info(&self) -> Result<ProcessInfo, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_PROCESS topic.
Sourcepub fn threads(&self) -> Result<Vec<Koid>, Status>
pub fn threads(&self) -> Result<Vec<Koid>, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_PROCESS_THREADS topic.
Sourcepub fn task_stats(&self) -> Result<TaskStatsInfo, Status>
pub fn task_stats(&self) -> Result<TaskStatsInfo, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_TASK_STATS topic.
Sourcepub fn info_maps_vec(&self) -> Result<Vec<MapInfo>, Status>
pub fn info_maps_vec(&self) -> Result<Vec<MapInfo>, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_PROCESS_MAPS topic.
Sourcepub fn exit(retcode: i64) -> !
pub fn exit(retcode: i64) -> !
Exit the current process with the given return code.
Wraps the zx_process_exit syscall.
Sourcepub fn handle_stats(&self) -> Result<ProcessHandleStats, Status>
pub fn handle_stats(&self) -> Result<ProcessHandleStats, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_PROCESS_HANDLE_STATS topic.
Sourcepub fn get_child(&self, koid: &Koid, rights: Rights) -> Result<Thread, Status>
pub fn get_child(&self, koid: &Koid, rights: Rights) -> Result<Thread, Status>
Wraps the zx_object_get_child syscall.
Sourcepub fn info_vmos_vec(&self) -> Result<Vec<VmoInfo>, Status>
pub fn info_vmos_vec(&self) -> Result<Vec<VmoInfo>, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_PROCESS_VMO topic.
Trait Implementations§
Source§impl AsHandleRef for Process
impl AsHandleRef for Process
Source§fn as_handle_ref(&self) -> Unowned<'_, Handle>
fn as_handle_ref(&self) -> Unowned<'_, Handle>
object_wait_many
.