Function clone_process

Source
pub fn clone_process<F>(
    ns: CloneNamespace,
    post_clone_cb: F,
) -> Result<pid_t, CloneError>
where F: FnOnce(),
Expand description

Clones this process and calls a closure in the new process.

After post_clone_cb returns or panics, the new process exits. Similar to how a fork syscall works, the new process is the same as the current process with the exception of the namespace controlled with the ns argument.

ยงArguments

  • ns - What namespace the new process will have (see NAMESPACES(7)).
  • post_clone_cb - Callback to run in the new process