From 74ef5300ef72fd21d42fea39c02f49c302fbb242 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 15 Oct 2021 15:29:15 -0700 Subject: [PATCH] Also note tool expectations of fork vs clone3 Co-authored-by: Josh Triplett --- library/std/src/sys/unix/process/process_unix.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs index 59ed4fc4ea4f..11d23a328900 100644 --- a/library/std/src/sys/unix/process/process_unix.rs +++ b/library/std/src/sys/unix/process/process_unix.rs @@ -168,6 +168,8 @@ fn clone3(cl_args: *mut clone_args, len: libc::size_t) -> libc::c_long // Bypassing libc for `clone3` can make further libc calls unsafe, // so we use it sparingly for now. See #89522 for details. + // Some tools (e.g. sandboxing tools) may also expect `fork` + // rather than `clone3`. let want_clone3 = self.get_create_pidfd(); // If we fail to create a pidfd for any reason, this will