pub fn sys_vfork() -> i32 {
    let mut sp: usize = 0;
    #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
    unsafe {
        asm!("mv $0, sp" : "=r" (sp) :: );
    }
    // TODO: more arch
    const CLONE_VFORK: usize = 0x00004000;
    const CLONE_VM: usize = 0x00000100;
    const SIGCHILD: usize = 17;
    sys_call(
        SyscallId::Clone,
        CLONE_VFORK | CLONE_VM | SIGCHILD,
        sp,
        0,
        0,
        0,
        0,
    )
}
/// 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_vfork() -> i32 {
    let mut sp: usize = 0;
    #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
    unsafe {
        asm!("mv $0, sp" : "=r" (sp) :: );
    }
    // TODO: more arch
    const CLONE_VFORK: usize = 0x00004000;
    const CLONE_VM: usize = 0x00000100;
    const SIGCHILD: usize = 17;
    sys_call(
        SyscallId::Clone,
        CLONE_VFORK | CLONE_VM | SIGCHILD,
        sp,
        0,
        0,
        0,
        0,
    )
}
pub fn sys_vfork ( ) -> i32 { let mut sp : usize = 0 ; # [ cfg ( any ( target_arch " " target_arch " " ) ) ] unsafe { asm ! ( " " " " ( sp ) ) ; } // TODO: more arch const CLONE_VFORK : usize = 0x00004000 ; const CLONE_VM : usize = 0x00000100 ; const SIGCHILD : usize = 17 ; sys_call ( SyscallId :: Clone , CLONE_VFORK | CLONE_VM | SIGCHILD , sp , 0 , 0 , 0 , 0 , ) }
Fork the current process.
Fork the current process .