Kernel: Add klibc for kernel

Now building same source as libc is not needed and libc doesn't
have to do hacks to allow kernel compilation
This commit is contained in:
2024-02-14 15:00:04 +02:00
parent b165340662
commit 198dde8365
4 changed files with 250 additions and 7 deletions

View File

@@ -136,7 +136,6 @@ char* strncat(char* __restrict__ dest, const char* __restrict__ src, size_t n)
return dest;
}
#ifndef __is_kernel
char* strdup(const char* str)
{
const size_t size = strlen(str) + 1;
@@ -162,9 +161,7 @@ char* strndup(const char* str, size_t size)
memcpy(new_str, str, size);
return new_str;
}
#endif
__attribute__((optimize("-O0")))
size_t strlen(const char* str)
{
size_t len = 0;