* Copyright 2003-2007, Axel DΓΆrfler, axeld@pinc-software.de. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
* Distributed under the terms of the NewOS License.
*/
#include <user_runtime.h>
#include <string.h>
#include <stdlib.h>
extern int main(int argc, char **argv, char **env);
extern void _init_c_library_(int argc, char **argv, char **env);
extern void _call_init_routines_(void);
int _start(int argc, char **argv, char **env);
extern char **argv_save;
extern thread_id __main_thread_id;
extern char **environ;
bool __gHaikuStartupCode = true;
int
_start(int argc, char **argv, char **environment)
{
int returnCode;
argv_save = argv;
__main_thread_id = find_thread(NULL);
#ifdef __HAIKU_BEOS_COMPATIBLE
_init_c_library_(argc, argv, environment);
_call_init_routines_();
#endif
returnCode = main(argc, argv, environment);
exit(returnCode);
return 0;
}