summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/mips/bits/syscalls.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/mips/bits/syscalls.h b/libc/sysdeps/linux/mips/bits/syscalls.h
index 787bb7d55..b8f80597e 100644
--- a/libc/sysdeps/linux/mips/bits/syscalls.h
+++ b/libc/sysdeps/linux/mips/bits/syscalls.h
@@ -29,6 +29,16 @@
} \
result_var; })
+#define INLINE_SYSCALL_NOERR_NCS(name, nr, args...) \
+({ \
+ INTERNAL_SYSCALL_DECL(err); \
+ long res = INTERNAL_SYSCALL_NCS(name, err, nr, args); \
+ if (unlikely(INTERNAL_SYSCALL_ERROR_P(res, err))) { \
+ res = -res; \
+ } \
+ res; \
+})
+
#define INTERNAL_SYSCALL_DECL(err) long err attribute_unused
#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err))