I've come across at_quick_exit
and quick_exit
while going over stdlib.h
and looking for functions that I haven't implemented.
I don't understand the point of having these two functions. Do they have any practical usage?
Basically it exists in C because of C++. The relevant document from WG 14 C standard committe can be found here.
The document was adapted from the paper accepted by the C++ standard. The idea behind quick_exit
is to exit the program without canceling all threads and without executing destructors of static objects. C doesn't has language support for such things as "destructors" at all and the thread support library in C is almost nowhere implemented. The at_quick_exit
and quick_exit
functions have very little to no meaning at all in C.
In C there is a function _Exit
that causes normal program termination to occur and control to be returned to the host environment
, but is not required to flush open file descriptors, write unbuffered data, close open files, as opposed to exit()
. Basically the at_quick_exit
and quick_exit
functions are facilities build to run custom user handles and then execute _Exit
, while atexit
is a facility to execute custom handlers upon calling exit()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With