pub unsafe fn do_clone(ctx: &ucontext, event: &ShimEventAddThreadReq) -> i64Expand description
Execute a native clone syscall, creating a new thread, which may be in
a new process (depending whether CLONE_THREAD is set).
If CLONE_THREAD is set, then the newly created child thread will resume
execution from ctx, which should be the point where the managed code
originally made a clone syscall (but was intercepted by seccomp).
Otherwise this function will return normally in both the parent and child
processes.
§Safety
ctxmust be dereferenceable, and must be safe for the newly spawned child thread to restore.- Other pointers, if non-null, must be safely dereferenceable.
child_stackmust be “sufficiently big” for the child thread to run on.tlsif provided must point to correctly initialized thread local storage.