AcessNative/nativefs - Fixed memory leak due to Close() not being bound
[tpg/acess2.git] / Usermode / Libraries / crt0.o_src / crt0.c
1 /*
2  * Acess2
3  * - C Runtime 0 Common Code
4  */
5
6 typedef void    (*exithandler_t)(void);
7 typedef void    (*constructor_t)(void);
8
9 exithandler_t   _crt0_exit_handler;
10 extern constructor_t    _crtbegin_ctors[];
11 extern void     _exit(int status) __attribute__((noreturn));
12
13 void start(int argc, char *argv[], char **envp)
14 {
15          int    i;
16          int    rv;
17         
18         for( i = 0; _crtbegin_ctors[i]; i ++ )
19                 _crtbegin_ctors[i]();
20
21         rv = main(argc, argv, envp);
22         
23         if( _crt0_exit_handler )
24                 _crt0_exit_handler();
25
26         _exit(rv);
27 }

UCC git Repository :: git.ucc.asn.au