void exit(int status) { pthread_mutex_lock(&exit_mutex); if (_exit_func) (*_exit_func)(); _fini(); syscall_exit(status); __builtin_unreachable(); }
static void __libc_fini_array() { size_t count, i; count = __preinit_array_end - __preinit_array_start; for (i = count - 1; i >= 0; i--) __fini_array_start[i](); _fini(); }
/* This function should not be used anymore. We run the executable's destructor now just like any other. We cannot remove the function, though. */ void __libc_csu_fini (void) { #ifndef LIBC_NONSHARED size_t i = __fini_array_end - __fini_array_start; while (i-- > 0) (*__fini_array_start [i]) (); _fini (); #endif }
void exit(int code) { // finalize libc __g_fini_libc(); // call global destructors _fini(); // quit task g_exit(code); __builtin_unreachable(); }
/* Run all the cleanup routines. */ void __libc_fini_array (void) { size_t count; size_t i; count = __fini_array_end - __fini_array_start; for (i = count; i > 0; i--) __fini_array_start[i-1] (); _fini (); }
/* Run all the cleanup routines. */ void __libc_fini_array (void) { size_t count; size_t i; count = __fini_array_end - __fini_array_start; for (i = 0; i < count; i++) __fini_array_start[i] (); _fini (); }
static void finalizer(void) { void (*fn)(void); size_t array_size, n; array_size = __fini_array_end - __fini_array_start; for (n = array_size; n > 0; n--) { fn = __fini_array_start[n - 1]; if ((uintptr_t)fn != 0 && (uintptr_t)fn != 1) (fn)(); } _fini(); }
_Noreturn void exit(int code) { __funcs_on_exit(); #ifndef SHARED uintptr_t a = (uintptr_t)&__fini_array_end; for (; a>(uintptr_t)&__fini_array_start; a-=sizeof(void(*)())) (*(void (**)())(a-sizeof(void(*)())))(); _fini(); #endif __stdio_exit(); _Exit(code); }
void _start( ) { _init(); __libc_init_malloc(); __runtime_init(); __libc_init_stdio(); int status = main(__runtime_info_block.argc, __runtime_info_block.argv); __libc_fini_stdio(); __runtime_fini(); _fini(); exit(status); while(1); }
_Noreturn void exit(int code) { static int lock; /* If more than one thread calls exit, hang until _Exit ends it all */ while (a_swap(&lock, 1)) __syscall(SYS_pause); __funcs_on_exit(); #ifndef SHARED uintptr_t a = (uintptr_t)&__fini_array_end; for (; a>(uintptr_t)&__fini_array_start; a-=sizeof(void(*)())) (*(void (**)())(a-sizeof(void(*)())))(); _fini(); #endif __flush_on_exit(); __seek_on_exit(); _Exit(code); for(;;); }
__noreturn void exit(int status) { _fini(); _Exit(status); }
void my_fini(void) { fprintf(stderr, "I'm in my_fini %s\n", __FILE__); // call the original... _fini(); }
static VOID ClassExpunge(UNUSED struct Library *base) { ENTER(); #ifdef USEMUISTRINGS if(StringClass) { MUI_DeleteCustomClass(StringClass); StringClass = NULL; } #endif if(ScrollGroupClass) { MUI_DeleteCustomClass(ScrollGroupClass); ScrollGroupClass = NULL; } if(CyberGfxBase) { DROPINTERFACE(ICyberGfx); CloseLibrary(CyberGfxBase); CyberGfxBase = NULL; } if(DataTypesBase) { DROPINTERFACE(IDataTypes); CloseLibrary(DataTypesBase); DataTypesBase = NULL; } if(DiskfontBase) { DROPINTERFACE(IDiskfont); CloseLibrary(DiskfontBase); DiskfontBase = NULL; } if(CxBase) { DROPINTERFACE(ICommodities); CloseLibrary(CxBase); CxBase = NULL; } if(KeymapBase) { DROPINTERFACE(IKeymap); CloseLibrary(KeymapBase); KeymapBase = NULL; } if(LayersBase) { DROPINTERFACE(ILayers); CloseLibrary(LayersBase); LayersBase = NULL; } _fini(); LEAVE(); }
int _exit(int val){ _fini(); return syscall_exit(val); }