]> xenbits.xensource.com Git - unikraft/unikraft.git/commit
lib/posix-process: Add `libc` system call wrapper for `clone`
authorSergiu Moga <sergiu@unikraft.io>
Mon, 24 Mar 2025 16:52:48 +0000 (18:52 +0200)
committerUnikraft Bot <monkey@unikraft.io>
Thu, 17 Apr 2025 12:33:46 +0000 (12:33 +0000)
commit50f0e935487cc83fa509a4692869958dfc1f8fca
treed36feae5d1cc5b75433fadb298dc5ebe3b2aa6f3
parent95a963bdd0eded913205597a8815629f5a34d6f4
lib/posix-process: Add `libc` system call wrapper for `clone`

In order to successfully call the clone system call through a libc
wrapper we need to be able to have an assembly sequence that both
translates the arguments passed by the libc wrapper to those of the
underlying syscall, since their signatures differ, as well as redirect
the parent and child accordingly upon exit from said syscall: child
must run its requested function and argument and parent must return
to the clone caller with an unscathed register context.

Said assembly sequence must be aware of the signature differences
between architectures, e.g. ARM64 vs x86_64 signatures of the
clone system call.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1618
lib/posix-process/Makefile.uk
lib/posix-process/arch/arm64/clone.S [new file with mode: 0644]
lib/posix-process/arch/x86_64/clone.S [new file with mode: 0644]
lib/posix-process/clone.c