From 69e6fe89fa9baafeca3e3515bb50897cd8ee7c35 Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 15 Dec 2025 18:24:54 +0100 Subject: Add getauxval and cleanup libc startup --- lib/libc/errno/errno.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/libc/errno/errno.c') 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 + int *__errno(void) { - static int __thread_errno = 0; - return &__thread_errno; + return &thrd_current()->terrno; } -- cgit v1.2.3