1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00

LibC: Enough compat work to make binutils-2.32 build and run.

This commit is contained in:
Andreas Kling 2019-02-23 17:24:50 +01:00
parent d7753c7c8d
commit a7a456002e
14 changed files with 110 additions and 45 deletions

View file

@ -149,11 +149,12 @@ void __malloc_init()
perror("set_mmap_name failed");
}
void* calloc(size_t nmemb, size_t)
void* calloc(size_t count, size_t size)
{
(void) nmemb;
ASSERT_NOT_REACHED();
return nullptr;
size_t new_size = count * size;
auto* ptr = malloc(new_size);
memset(ptr, 0, new_size);
return ptr;
}
void* realloc(void *ptr, size_t size)
@ -200,6 +201,11 @@ char* getenv(const char* name)
return nullptr;
}
double atof(const char*)
{
assert(false);
}
int atoi(const char* str)
{
size_t len = strlen(str);
@ -298,4 +304,9 @@ ldiv_t ldiv(long numerator, long denominator)
return result;
}
size_t mbstowcs(wchar_t*, const char*, size_t)
{
assert(false);
}
}