Luna/libs/libc/src/stdlib.cpp
apio 743aedcd49 libc: Implement atexit() and _exit()
exit() now calls registered handlers before calling _exit().

And initialize_libc() can now register a handler to close stdout and stderr on program termination!! :)
2022-10-12 20:41:55 +02:00

22 lines
305 B
C++

#include <luna.h>
#include <stdlib.h>
#include <sys/syscall.h>
#include <unistd.h>
extern "C"
{
noreturn void abort()
{
_exit(-1);
}
int atoi(const char*)
{
NOT_IMPLEMENTED("atoi");
}
char* getenv(const char*)
{
NOT_IMPLEMENTED("getenv");
}
}