summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/internal/syscall_ret.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/internal/syscall_ret.c')
-rw-r--r--libc-top-half/musl/src/internal/syscall_ret.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/internal/syscall_ret.c b/libc-top-half/musl/src/internal/syscall_ret.c
new file mode 100644
index 0000000..a3f4713
--- /dev/null
+++ b/libc-top-half/musl/src/internal/syscall_ret.c
@@ -0,0 +1,11 @@
+#include <errno.h>
+#include "syscall.h"
+
+long __syscall_ret(unsigned long r)
+{
+ if (r > -4096UL) {
+ errno = -r;
+ return -1;
+ }
+ return r;
+}