pub fn sys_fork(&self) -> SysResult {
        info!("fork:");
        let new_proc = Process::fork_from(self.zircon_process(), false)?; // old pt NULL here
        let new_thread = Thread::create_linux(&new_proc)?;

        #[cfg(not(target_arch = "riscv64"))]
        new_thread.start_with_regs(GeneralRegs::new_fork(self.regs), self.thread_fn)?;

        #[cfg(target_arch = "riscv64")]
        new_thread.start_with_context(self.context, self.thread_fn)?;

        info!("fork: {} -> {}", self.zircon_process().id(), new_proc.id());
        Ok(new_proc.id() as usize)
    }
/// Fork the current process. Return the child's PID.
Fork the current process. Return the child's PID.
Fork the current process . Return the child ' s PID .
pub fn sys_fork(&self) -> SysResult {
        info!("fork:");
        let new_proc = Process::fork_from(self.zircon_process(), false)?; // old pt NULL here
        let new_thread = Thread::create_linux(&new_proc)?;
        #[cfg(not(target_arch = "riscv64"))]
        new_thread.start_with_regs(GeneralRegs::new_fork(self.regs), self.thread_fn)?;
        #[cfg(target_arch = "riscv64")]
        new_thread.start_with_context(self.context, self.thread_fn)?;
        info!("fork: {} -> {}", self.zircon_process().id(), new_proc.id());
        Ok(new_proc.id() as usize)
    }
pub fn sys_fork ( & self ) -> SysResult { info ! ( " " ) ; let new_proc = Process :: fork_from ( self . zircon_process ( ) , false ) ? ; // old pt NULL here let new_thread = Thread :: create_linux ( & new_proc ) ? ; # [ cfg ( not ( target_arch " " ) ) ] new_thread . start_with_regs ( GeneralRegs :: new_fork ( self . regs ) , self . thread_fn ) ? ; # [ cfg ( target_arch " " ) ] new_thread . start_with_context ( self . context , self . thread_fn ) ? ; info ! ( " " self zircon_process ( ) id ( ) new_proc id ( ) ) ; Ok ( new_proc . id ( ) as usize ) }
Fork the current process.
Fork the current process .
&self
&self