pub async fn sys_vfork(&self) -> SysResult {
        info!("vfork:");
        let new_proc = Process::fork_from(self.zircon_process(), true)?;
        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)?;

        let new_proc: Arc<dyn KernelObject> = new_proc;
        info!(
            "vfork: {} -> {}. Waiting for execve SIGNALED",
            self.zircon_process().id(),
            new_proc.id()
        );
        new_proc.wait_signal(Signal::SIGNALED).await; // wait for execve
        Ok(new_proc.id() as usize)
    }
/// creates a child process of the calling process, similar to fork but wait for execve
creates a child process of the calling process, similar to fork but wait for execve
creates a child process of the calling process similar to fork but wait for execve
pub async fn sys_vfork(&self) -> SysResult {
        info!("vfork:");
        let new_proc = Process::fork_from(self.zircon_process(), true)?;
        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)?;
        let new_proc: Arc<dyn KernelObject> = new_proc;
        info!(
            "vfork: {} -> {}. Waiting for execve SIGNALED",
            self.zircon_process().id(),
            new_proc.id()
        );
        new_proc.wait_signal(Signal::SIGNALED).await; // wait for execve
        Ok(new_proc.id() as usize)
    }
pub async fn sys_vfork ( & self ) -> SysResult { info ! ( " " ) ; let new_proc = Process :: fork_from ( self . zircon_process ( ) , true ) ? ; 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 ) ? ; let new_proc : Arc < dyn KernelObject > = new_proc ; info ! ( " " self zircon_process ( ) id ( ) new_proc id ( ) ) ; new_proc . wait_signal ( Signal :: SIGNALED ) . await ; // wait for execve Ok ( new_proc . id ( ) as usize ) }
creates a child process of the calling process, similar to fork but wait for execve
creates a child process of the calling process similar to fork but wait for execve
&self
&self