pub fn sys_process_create(
        &self,
        job: HandleValue,
        name: UserInPtr<u8>,
        name_size: usize,
        options: u32,
        mut proc_handle: UserOutPtr<HandleValue>,
        mut vmar_handle: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        let name = name.read_string(name_size)?;
        info!(
            "proc.create: job={:#x?}, name={:?}, options={:#x?}",
            job, name, options,
        );
        if options != 0 {
            return Err(ZxError::INVALID_ARGS);
        }
        let proc = self.thread.proc();
        let job = proc
            .get_object_with_rights::<Job>(job, Rights::MANAGE_PROCESS)
            .or_else(|_| proc.get_object_with_rights::<Job>(job, Rights::WRITE))?;
        let new_proc = Process::create(&job, &name)?;
        let new_vmar = new_proc.vmar();
        let proc_handle_value = proc.add_handle(Handle::new(new_proc, Rights::DEFAULT_PROCESS));
        let vmar_handle_value = proc.add_handle(Handle::new(
            new_vmar,
            Rights::DEFAULT_VMAR | Rights::READ | Rights::WRITE | Rights::EXECUTE,
        ));
        proc_handle.write(proc_handle_value)?;
        vmar_handle.write(vmar_handle_value)?;
        Ok(())
    }
/// Create a new process.
///
/// Upon success, handles for the new process and the root of its address space are returned.
Create a new process.
Upon success, handles for the new process and the root of its address space are returned.
Create a new process . Upon success handles for the new process and the root of its address space are returned .
pub fn sys_process_create(
        &self,
        job: HandleValue,
        name: UserInPtr<u8>,
        name_size: usize,
        options: u32,
        mut proc_handle: UserOutPtr<HandleValue>,
        mut vmar_handle: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        let name = name.read_string(name_size)?;
        info!(
            "proc.create: job={:#x?}, name={:?}, options={:#x?}",
            job, name, options,
        );
        if options != 0 {
            return Err(ZxError::INVALID_ARGS);
        }
        let proc = self.thread.proc();
        let job = proc
            .get_object_with_rights::<Job>(job, Rights::MANAGE_PROCESS)
            .or_else(|_| proc.get_object_with_rights::<Job>(job, Rights::WRITE))?;
        let new_proc = Process::create(&job, &name)?;
        let new_vmar = new_proc.vmar();
        let proc_handle_value = proc.add_handle(Handle::new(new_proc, Rights::DEFAULT_PROCESS));
        let vmar_handle_value = proc.add_handle(Handle::new(
            new_vmar,
            Rights::DEFAULT_VMAR | Rights::READ | Rights::WRITE | Rights::EXECUTE,
        ));
        proc_handle.write(proc_handle_value)?;
        vmar_handle.write(vmar_handle_value)?;
        Ok(())
    }
pub fn sys_process_create ( & self , job : HandleValue , name : UserInPtr < u8 > , name_size : usize , options : u32 , mut proc_handle : UserOutPtr < HandleValue > , mut vmar_handle : UserOutPtr < HandleValue > , ) -> ZxResult { let name = name . read_string ( name_size ) ? ; info ! ( " " job name options ) ; if options != 0 { return Err ( ZxError :: INVALID_ARGS ) ; } let proc = self . thread . proc ( ) ; let job = proc . get_object_with_rights :: < Job > ( job , Rights :: MANAGE_PROCESS ) . or_else ( | _ | proc . get_object_with_rights :: < Job > ( job , Rights :: WRITE ) ) ? ; let new_proc = Process :: create ( & job , & name ) ? ; let new_vmar = new_proc . vmar ( ) ; let proc_handle_value = proc . add_handle ( Handle :: new ( new_proc , Rights :: DEFAULT_PROCESS ) ) ; let vmar_handle_value = proc . add_handle ( Handle :: new ( new_vmar , Rights :: DEFAULT_VMAR | Rights :: READ | Rights :: WRITE | Rights :: EXECUTE , ) ) ; proc_handle . write ( proc_handle_value ) ? ; vmar_handle . write ( vmar_handle_value ) ? ; Ok ( ( ) ) }
Create a new process.
Create a new process .
&self
job
HandleValue
name
UserInPtr<u8>
name_size
usize
options
u32
proc_handle
UserOutPtr<HandleValue>
vmar_handle
UserOutPtr<HandleValue>
&self
job
HandleValue
name
UserInPtr<u8>
name_size
usize
options
u32
proc_handle
UserOutPtr<HandleValue>
vmar_handle
UserOutPtr<HandleValue>