mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
LibC: Avoid ninja-imports of system functions
This adds a new header <sys/internals.h>, which provides access to LibC internals. This is in the interest of type-checking LibC itself, as well as enabling less-hacky access for uses like LinkDemo. And, of course, this progresses LibC towards building cleanly with -Wmissing-declarations.
This commit is contained in:
parent
9221a25bbc
commit
9d2d97a059
6 changed files with 49 additions and 14 deletions
|
@ -26,6 +26,8 @@
|
|||
|
||||
#include <AK/Types.h>
|
||||
#include <assert.h>
|
||||
#include <sys/internals.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
@ -35,10 +37,7 @@ bool __environ_is_malloced;
|
|||
|
||||
void __libc_init()
|
||||
{
|
||||
void __malloc_init();
|
||||
__malloc_init();
|
||||
|
||||
void __stdio_init();
|
||||
__stdio_init();
|
||||
}
|
||||
|
||||
|
@ -52,9 +51,9 @@ void __libc_init()
|
|||
extern u32 __stack_chk_guard;
|
||||
u32 __stack_chk_guard = (u32)0xc6c7c8c9;
|
||||
|
||||
[[noreturn]] void __stack_chk_fail();
|
||||
[[noreturn]] void __stack_chk_fail()
|
||||
{
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue