blob: 393aec2ddcdf1a93f8e7caac454ee9a33a1f9b05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include <stdio.h>
#include <string.h>
#include <Kernel/Syscall.h>
#include <AK/StringImpl.h>
extern "C" int main(int, char**);
int errno;
char** environ;
extern "C" void __malloc_init();
extern "C" void __stdio_init();
extern "C" int _start()
{
errno = 0;
__stdio_init();
__malloc_init();
int status = 254;
int argc;
char** argv;
int rc = syscall(SC_get_arguments, &argc, &argv);
if (rc < 0)
goto epilogue;
rc = syscall(SC_get_environment, &environ);
if (rc < 0)
goto epilogue;
status = main(argc, argv);
fflush(stdout);
fflush(stderr);
epilogue:
syscall(SC_exit, status);
// Birger's birthday <3
return 20150614;
}
|