mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
aarch64: add vfork
The generic vfork implementation uses clone(SIGCHLD) which has fork semantics. Implement vfork as clone(SIGCHLD|CLONE_VM|CLONE_VFORK, 0) instead which has vfork semantics. (stack == 0 means sp is unchanged in the child.) Some users rely on vfork semantics when memory overcommit is disabled or when the vfork child runs code that synchronizes with the parent process (non-conforming).
This commit is contained in:
parent
7d568410b4
commit
4f48da008d
1 changed files with 9 additions and 0 deletions
9
src/process/aarch64/vfork.s
Normal file
9
src/process/aarch64/vfork.s
Normal file
|
@ -0,0 +1,9 @@
|
|||
.global vfork
|
||||
.type vfork,%function
|
||||
vfork:
|
||||
mov x8, 220 // SYS_clone
|
||||
mov x0, 0x4111 // SIGCHLD | CLONE_VM | CLONE_VFORK
|
||||
mov x1, 0
|
||||
svc 0
|
||||
.hidden __syscall_ret
|
||||
b __syscall_ret
|
Loading…
Add table
Reference in a new issue