summaryrefslogtreecommitdiff
path: root/lib/libc/errno
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-15 18:24:54 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-15 18:24:54 +0100
commit69e6fe89fa9baafeca3e3515bb50897cd8ee7c35 (patch)
tree489046ce167b8b20d205f87f4ae1f4b680c19b43 /lib/libc/errno
parent0d5bffe9d2caadc1215c875e560c52bca5161c54 (diff)
Add getauxval and cleanup libc startup
Diffstat (limited to 'lib/libc/errno')
-rw-r--r--lib/libc/errno/errno.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libc/errno/errno.c b/lib/libc/errno/errno.c
index 55423e22..09b22f4d 100644
--- a/lib/libc/errno/errno.c
+++ b/lib/libc/errno/errno.c
@@ -1,8 +1,7 @@
-// TODO: Should return the address of the calling thread's `errno` storage.
-// Currently, this is a stub implementation that returns the address of a
-// static variable.
+#include <__thread.h>
+#include <threads.h>
+
int *__errno(void)
{
- static int __thread_errno = 0;
- return &__thread_errno;
+ return &thrd_current()->terrno;
}