mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
riscv64: add vfork
Implement vfork() using clone(CLONE_VM | CLONE_VFORK | ...).
This commit is contained in:
parent
269d193820
commit
5763f003a5
1 changed files with 12 additions and 0 deletions
12
src/process/riscv64/vfork.s
Normal file
12
src/process/riscv64/vfork.s
Normal file
|
@ -0,0 +1,12 @@
|
|||
.global vfork
|
||||
.type vfork,@function
|
||||
vfork:
|
||||
/* riscv does not have SYS_vfork, so we must use clone instead */
|
||||
/* note: riscv's clone = clone(flags, sp, ptidptr, tls, ctidptr) */
|
||||
li a7, 220
|
||||
li a0, 0x100 | 0x4000 | 17 /* flags = CLONE_VM | CLONE_VFORK | SIGCHLD */
|
||||
mv a1, sp
|
||||
/* the other arguments are ignoreable */
|
||||
ecall
|
||||
.hidden __syscall_ret
|
||||
j __syscall_ret
|
Loading…
Add table
Reference in a new issue