about summary refs log tree commit diff
path: root/src/internal/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/syscall.c')
-rw-r--r--src/internal/syscall.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/internal/syscall.c b/src/internal/syscall.c
new file mode 100644
index 00000000..4f159e0b
--- /dev/null
+++ b/src/internal/syscall.c
@@ -0,0 +1,11 @@
+#include <errno.h>
+#include <unistd.h>
+
+long __syscall_ret(unsigned long r)
+{
+	if (r >= (unsigned long)-1 - 4096) {
+		errno = -(long)r;
+		return -1;
+	}
+	return (long)r;
+}