ladybird/LibC/entry.cpp
Andreas Kling e904f193c1 Canonicalize the path used by sh.
With a bunch of LibC work to support the feature. LibC now initializes
AK::StringImpl by default. It's now fine to use AK in LibC/Userland! :^)
2018-10-28 09:36:21 +01:00

25 lines
470 B
C++

#include <Kernel/Syscall.h>
#include <AK/StringImpl.h>
extern "C" int main(int, char**);
int errno;
extern "C" int _start()
{
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);
// Birger's birthday <3
return 20150614;
}