Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/stdlib/exit.c
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
exit(int status) | exit(int status) | ||||
{ | { | ||||
/* Ensure that the auto-initialization routine is linked in: */ | /* Ensure that the auto-initialization routine is linked in: */ | ||||
extern int _thread_autoinit_dummy_decl; | extern int _thread_autoinit_dummy_decl; | ||||
_thread_autoinit_dummy_decl = 1; | _thread_autoinit_dummy_decl = 1; | ||||
/* | |||||
* We're dealing with cleaning up thread_local destructors in the case of | |||||
* the process termination through main() exit. | |||||
* Other cases are handled elsewhere. | |||||
*/ | |||||
__cxa_thread_call_dtors(); | |||||
__cxa_finalize(NULL); | __cxa_finalize(NULL); | ||||
if (__cleanup) | if (__cleanup) | ||||
(*__cleanup)(); | (*__cleanup)(); | ||||
_exit(status); | _exit(status); | ||||
} | } |