2 * Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Copyright 2001, Travis Geiselbrecht. All rights reserved.
6 * Distributed under the terms of the NewOS License.
10 #include <user_runtime.h>
16 extern int main(int argc
, char **argv
, char **env
);
17 extern void _init_c_library_(int argc
, char **argv
, char **env
);
18 extern void _call_init_routines_(void);
20 int _start(int argc
, char **argv
, char **env
);
22 // these are part of libroot.so, and initialized here
23 extern char **argv_save
;
24 extern thread_id __main_thread_id
;
25 extern char **environ
;
27 bool __gHaikuStartupCode
= true;
31 _start(int argc
, char **argv
, char **environment
)
36 __main_thread_id
= find_thread(NULL
);
38 // These two are called to make our glue code usable under BeOS R5
39 // - in Haiku, they are both empty.
40 _init_c_library_(argc
, argv
, environment
);
41 _call_init_routines_();
43 returnCode
= main(argc
, argv
, environment
);