fix dup3 ignoring all flags but O_CLOEXEC on archs with SYS_dup2 syscall
[musl] / src / thread / mips64 / clone.s
index 229d267..2d86899 100644 (file)
@@ -1,5 +1,6 @@
 .set   noreorder
 .global        __clone
+.hidden __clone
 .type  __clone,@function
 __clone:
        # Save function pointer and argument pointer on new thread stack
@@ -26,5 +27,8 @@ __clone:
        nop
 1:     ld      $25, 0($sp)     # function pointer
        ld      $4, 8($sp)      # argument pointer
-       jr      $25             # call the user's function
+       jalr    $25             # call the user's function
        nop
+       move    $4, $2
+       li      $2, 5058
+       syscall