diff --git a/src/sched.rs b/src/sched.rs index 0515e30f29..c1e1488af9 100644 --- a/src/sched.rs +++ b/src/sched.rs @@ -95,7 +95,17 @@ mod sched_linux_like { /// address need not be the highest address of the region. Nix will take /// care of that requirement. The user only needs to provide a reference to /// a normally allocated buffer. - pub fn clone( + /// + /// # Safety + /// + /// Because `clone` creates a child process with its stack located in + /// `stack` without specifying the size of the stack, special care must be + /// taken to ensure that the child process does not overflow the provided + /// stack space. + /// + /// See [`fork`](crate::unistd::fork) for additional safety concerns related + /// to executing child processes. + pub unsafe fn clone( mut cb: CloneCb, stack: &mut [u8], flags: CloneFlags,