ladybird/LibC/entry.cpp

25 lines
470 B
C++
Raw Normal View History

2018-10-22 15:06:22 +03:00
#include <Kernel/Syscall.h>
#include <AK/StringImpl.h>
2018-10-22 15:06:22 +03:00
extern "C" int main(int, char**);
int errno;
extern "C" int _start()
2018-10-22 15:06:22 +03:00
{
errno = 0;
StringImpl::initializeGlobals();
int argc;
char** argv;
int rc = Syscall::invoke(Syscall::GetArguments, (dword)&argc, (dword)&argv);
int status = 254;
if (rc == 0)
status = main(argc, argv);
Syscall::invoke(Syscall::PosixExit, status);
2018-10-22 15:06:22 +03:00
// Birger's birthday <3
return 20150614;
}