An alternative termination handler
void shortCleanup(void) { /* abbreviated cleanup */ } int main(void) { at_quick_exit(shortCleanup); quick_exit(1); } Passing shortCleanup without () registers the function rather than calling it immediately. quick_exit then terminates through the handlers registered with at_quick_exit. section 8.8
quick_exit uses a termination-handler list separate from the normal atexit list. It is an option when normal handlers take too long or termination must begin in a signal handler. Use it with care. section 8.8
TAKEAWAY — choose the termination path deliberately:
- Normal termination uses atexit handlers; quick_exit uses handlers registered with at_quick_exit. section 8.8
- _Exit runs neither application-specific handler list. abort also inhibits some system cleanup. section 8.8
In one signal-handler arrangement, SIGTERM leads to quick_exit and therefore runs the at_quick_exit cleanup list. SIGABRT instead leads to _Exit; SIGINT returns to the interrupted execution. section 19.6

