From fc00c656c96528112d05cf0edf8631bd5eaea446 Mon Sep 17 00:00:00 2001 From: Kacper Date: Sun, 7 Dec 2025 20:10:31 +0100 Subject: Add build system scaffolding and libc headers --- lib/libc/errno/errno.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/libc/errno/errno.c (limited to 'lib/libc/errno/errno.c') diff --git a/lib/libc/errno/errno.c b/lib/libc/errno/errno.c new file mode 100644 index 00000000..55423e22 --- /dev/null +++ b/lib/libc/errno/errno.c @@ -0,0 +1,8 @@ +// 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. +int *__errno(void) +{ + static int __thread_errno = 0; + return &__thread_errno; +} -- cgit v1.2.3