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 create(
job: &Job,
name: Name,
options: ProcessOptions,
) -> Result<(Process, Vmar), Status>
pub fn create( job: &Job, name: Name, options: ProcessOptions, ) -> Result<(Process, Vmar), Status>
Create a new process and its address space.
Wraps the zx_process_create syscall.
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.
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) -> Unowned<'_, Handle>
fn as_handle_ref(&self) -> Unowned<'_, Handle>
object_wait_many
.Source§fn raw_handle(&self) -> u32
fn raw_handle(&self) -> u32
Source§fn signal_handle(
&self,
clear_mask: Signals,
set_mask: Signals,
) -> Result<(), Status>
fn signal_handle( &self, clear_mask: Signals, set_mask: Signals, ) -> Result<(), Status>
Source§fn wait_handle(
&self,
signals: Signals,
deadline: Instant<MonotonicTimeline>,
) -> Result<Signals, Status>
fn wait_handle( &self, signals: Signals, deadline: Instant<MonotonicTimeline>, ) -> Result<Signals, Status>
Source§fn wait_async_handle(
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts,
) -> Result<(), Status>
fn wait_async_handle( &self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts, ) -> Result<(), Status>
Source§fn get_name(&self) -> Result<Name, Status>
fn get_name(&self) -> Result<Name, Status>
Source§fn set_name(&self, name: &Name) -> Result<(), Status>
fn set_name(&self, name: &Name) -> Result<(), Status>
Source§fn basic_info(&self) -> Result<HandleBasicInfo, Status>
fn basic_info(&self) -> Result<HandleBasicInfo, Status>
Source§fn count_info(&self) -> Result<HandleCountInfo, Status>
fn count_info(&self) -> Result<HandleCountInfo, Status>
Source§impl HandleBased for Process
impl HandleBased for Process
Source§fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
Source§fn replace_handle(self, rights: Rights) -> Result<Self, Status>
fn replace_handle(self, rights: Rights) -> Result<Self, Status>
Source§fn into_handle(self) -> Handle
fn into_handle(self) -> Handle
Source§fn from_handle(handle: Handle) -> Self
fn from_handle(handle: Handle) -> Self
Source§fn into_handle_based<H>(self) -> Hwhere
H: HandleBased,
fn into_handle_based<H>(self) -> Hwhere
H: HandleBased,
Source§fn from_handle_based<H>(h: H) -> Selfwhere
H: HandleBased,
fn from_handle_based<H>(h: H) -> Selfwhere
H: HandleBased,
fn is_invalid_handle(&self) -> bool
Source§impl Ord for Process
impl Ord for Process
Source§impl PartialOrd for Process
impl PartialOrd for Process
§impl TakeFrom<WireHandle> for Process
impl TakeFrom<WireHandle> for Process
§fn take_from(from: &WireHandle) -> Process
fn take_from(from: &WireHandle) -> Process
T
, taking any resources that can’t be cloned.§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
take_from
. Read more