Skip to content

Commit

Permalink
implements clone fallback
Browse files Browse the repository at this point in the history
implements a clone fallback path when `clone3` is blocked with ENOSYS

Removed the use of clone3 crate. Our usecase for the clone3 crate is
very specific and do not need to support everything. I can easily
replace the clone3 crate with a few lines of code, so I did it in this
PR. We usually favors safe syscall wrappers like nix over libc, but I
believe the save is worth it here.  We use the raw clone syscall instead
of glibc wrapper. Details are in the comments.  Using raw syscalls for
both clone and clone3 actually makes the code well organized. For our
usecase, they share the input types.  Unit tests using seccomp profile
to simulate clone3 being blocked are added.

Signed-off-by: yihuaf <[email protected]>
  • Loading branch information
yihuaf committed Jun 23, 2023
1 parent dfe6ee8 commit 884d7e8
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 110 deletions.
Loading

0 comments on commit 884d7e8

Please sign in to comment.