summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/mips/syscall.S
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/mips/syscall.S')
-rw-r--r--libc/sysdeps/linux/mips/syscall.S10
1 files changed, 10 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/mips/syscall.S b/libc/sysdeps/linux/mips/syscall.S
index d5b1cbe3c..965eeac1e 100644
--- a/libc/sysdeps/linux/mips/syscall.S
+++ b/libc/sysdeps/linux/mips/syscall.S
@@ -60,6 +60,16 @@ syscall:
#else
addiu sp,sp,32
#endif
+ bnez a3, 1f
j ra /* Return to caller. */
+1:
+ move a0,v0 /* Pass return val to C function. */
+
+#ifdef __PIC__
+ PTR_LA t9, __syscall_error
+ jr t9
+#else
+ j __syscall_error
+#endif
.end syscall
.size syscall,.-syscall