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: zx_vaddr_t,
bytes: &[u8],
) -> Result<usize, Status>
pub fn write_memory( &self, vaddr: zx_vaddr_t, bytes: &[u8], ) -> Result<usize, Status>
Write memory inside a process.
Wraps the zx_process_write_memory syscall.
Sourcepub fn read_memory(
&self,
vaddr: zx_vaddr_t,
bytes: &mut [u8],
) -> Result<usize, Status>
pub fn read_memory( &self, vaddr: zx_vaddr_t, 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: zx_vaddr_t,
buffer: &'a mut [MaybeUninit<u8>],
) -> Result<(&'a mut [u8], &'a mut [MaybeUninit<u8>]), Status>
pub fn read_memory_uninit<'a>( &self, vaddr: zx_vaddr_t, 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.
Sourcepub fn info_maps<'a>(
&self,
info_out: &'a mut [MaybeUninit<MapInfo>],
) -> Result<(&'a mut [MapInfo], &'a mut [MaybeUninit<MapInfo>], usize), Status>
pub fn info_maps<'a>( &self, info_out: &'a mut [MaybeUninit<MapInfo>], ) -> Result<(&'a mut [MapInfo], &'a mut [MaybeUninit<MapInfo>], usize), Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_PROCESS_MAPS topic. Contrarily to Process::info_vmos_vec, this method ensures that no intermediate copy of the data is made, at the price of a less convenient interface.
Sourcepub fn info_vmos<'a>(
&self,
info_out: &'a mut [MaybeUninit<VmoInfo>],
) -> Result<(&'a mut [VmoInfo], &'a mut [MaybeUninit<VmoInfo>], usize), Status>
pub fn info_vmos<'a>( &self, info_out: &'a mut [MaybeUninit<VmoInfo>], ) -> Result<(&'a mut [VmoInfo], &'a mut [MaybeUninit<VmoInfo>], usize), Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_PROCESS_VMO topic. Contrarily to Process::info_vmos_vec, this method ensures that no intermediate copy of the data is made, at the price of a less convenient interface.
Trait Implementations§
Source§impl AsHandleRef for Process
impl AsHandleRef for Process
Source§fn as_handle_ref(&self) -> HandleRef<'_>
fn as_handle_ref(&self) -> HandleRef<'_>
object_wait_many
.