fn clone(child_stack: *mut libc::c_void, flags: libc::c_int) -> Result<libc::c_int> {
    // Clone parameters order is different between x86_64 and aarch64.
    #[cfg(target_arch = "x86_64")]
    return SyscallReturnCode(unsafe {
        libc::syscall(libc::SYS_clone, flags, child_stack, 0, 0, 0) as libc::c_int
    })
    .into_result()
    .map_err(Error::Clone);
    #[cfg(target_arch = "aarch64")]
    return SyscallReturnCode(unsafe {
        libc::syscall(libc::SYS_clone, flags, child_stack, 0, 0, 0) as libc::c_int
    })
    .into_result()
    .map_err(Error::Clone);
}
// This is a wrapper for the clone system call. When we want to create a new process in a new
// pid namespace, we will call clone with a NULL stack pointer. We can do this because we will
// not use the CLONE_VM flag, this will result with the original stack replicated, in a similar
// manner to the fork syscall. The libc wrapper prevents use of a NULL stack pointer, so we will
// call the syscall directly.
This is a wrapper for the clone system call. When we want to create a new process in a new
pid namespace, we will call clone with a NULL stack pointer. We can do this because we will
not use the CLONE_VM flag, this will result with the original stack replicated, in a similar
manner to the fork syscall. The libc wrapper prevents use of a NULL stack pointer, so we will
call the syscall directly.
This is a wrapper for the clone system call . When we want to create a new process in a new pid namespace we will call clone with a NULL stack pointer . We can do this because we will not use the CLONE_VM flag this will result with the original stack replicated in a similar manner to the fork syscall . The libc wrapper prevents use of a NULL stack pointer so we will call the syscall directly .
fn clone(child_stack: *mut libc::c_void, flags: libc::c_int) -> Result<libc::c_int> {
    // Clone parameters order is different between x86_64 and aarch64.
    #[cfg(target_arch = "x86_64")]
    return SyscallReturnCode(unsafe {
        libc::syscall(libc::SYS_clone, flags, child_stack, 0, 0, 0) as libc::c_int
    })
    .into_result()
    .map_err(Error::Clone);
    #[cfg(target_arch = "aarch64")]
    return SyscallReturnCode(unsafe {
        libc::syscall(libc::SYS_clone, flags, child_stack, 0, 0, 0) as libc::c_int
    })
    .into_result()
    .map_err(Error::Clone);
}
fn clone ( child_stack : * mut libc :: c_void , flags : libc :: c_int ) -> Result < libc :: c_int > { // Clone parameters order is different between x86_64 and aarch64. # [ cfg ( target_arch " " ) ] return SyscallReturnCode ( unsafe { libc :: syscall ( libc :: SYS_clone , flags , child_stack , 0 , 0 , 0 ) as libc :: c_int } ) . into_result ( ) . map_err ( Error :: Clone ) ; # [ cfg ( target_arch " " ) ] return SyscallReturnCode ( unsafe { libc :: syscall ( libc :: SYS_clone , flags , child_stack , 0 , 0 , 0 ) as libc :: c_int } ) . into_result ( ) . map_err ( Error :: Clone ) ; }
This is a wrapper for the clone system call.
This is a wrapper for the clone system call .
child_stack
*mut libc::c_void
flags
libc::c_int
child_stack
*mut libc::c_void
flags
libc::c_int