xref: /aosp_15_r20/external/musl/src/process/riscv64/vfork.s (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1.global vfork
2.type vfork,@function
3vfork:
4	/* riscv does not have SYS_vfork, so we must use clone instead */
5	/* note: riscv's clone = clone(flags, sp, ptidptr, tls, ctidptr) */
6	li a7, 220
7	li a0, 0x100 | 0x4000 | 17 /* flags = CLONE_VM | CLONE_VFORK | SIGCHLD */
8	mv a1, sp
9	/* the other arguments are ignoreable */
10	ecall
11	.hidden __syscall_ret
12	j __syscall_ret
13