_Noreturn void quick_exit (int status);
[[noreturn]] void quick_exit (int status) noexcept;
Terminate calling process quick
Terminates the process normally by returning control to the host environment after calling all functions registered using at_quick_exit.
No additional cleanup tasks are performed: No object destructors are called. Although whether C streams are closed and/or flushed, and files open with tmpfile are removed depends on the particular system or library implementation.
If status is zero or EXIT_SUCCESS, a successful termination status is returned to the host environment.
If status is EXIT_FAILURE, an unsuccessful termination status is returned to the host environment.
Otherwise, the status returned depends on the system and library implementation.
If a program calls both exit and quick_exit, or quick_exit more than once, it causes undefined behavior.
- Status code.
If this is
0 or EXIT_SUCCESS, it indicates success.
If it is EXIT_FAILURE, it indicates failure.
none (the function never returns).
/* quick_exit example */
#include <stdio.h> /* puts */
#include <stdlib.h> /* at_quick_exit, quick_exit, EXIT_SUCCESS */
void fnQExit (void)
puts ("Quick exit function.");
int main ()
puts ("Main function: Beginning");
puts ("Main function: End"); // never executed
Main function: Beginning
Quick exit function.
Concurrently calling this function multiple times has no effect.
Calls to at_quick_exit that do not complete before the call to this function may not succeed (depends on particular library implementation).
No-throw guarantee: this function never throws exceptions.
If any of the functions registered with at_quick_exit throws an exception, terminate is automatically called.
- Set function to be executed on quick exit (function)
- Terminate calling process (function)
- Abort current process (function)