From 90dad97fc07f049383903a166631e2c257f9b8c1 Mon Sep 17 00:00:00 2001 From: Kacper Date: Tue, 16 Dec 2025 17:02:05 +0100 Subject: Add support for TLS in the libc --- lib/libc/internal/syscall.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/libc/internal/syscall.c (limited to 'lib/libc/internal/syscall.c') diff --git a/lib/libc/internal/syscall.c b/lib/libc/internal/syscall.c new file mode 100644 index 00000000..f7fd3c4b --- /dev/null +++ b/lib/libc/internal/syscall.c @@ -0,0 +1,12 @@ +#include +#include + +long __syscall_ret(long ret) +{ + if (__predict_false(ret > -4096 && ret < 0)) { + errno = (int)-ret; + ret = -1; + } + + return ret; +} -- cgit v1.2.3