liveBook · Manning

Quick_exit

As explained in Modern C

quick_exit is the C standard library function that performs expedited program termination while invoking functions registered with at_quick_exit.

quick_exit performs expedited program termination by invoking functions registered with at_quick_exit. It provides an alternative to normal atexit handling when that handling would take too long; use it with care. section 8.7

Choosing an alternative termination path

Register a no-argument termination handler with at_quick_exit, then call quick_exit(status) when the normal atexit handler list is too time-consuming. The registered function is passed as a reference, not called during registration. section 8.7

Distinguish quick_exit from the more severe termination functions:

  • _Exit inhibits application-specific handlers, while abort also inhibits some system cleanups. section 8.7

How Modern C covers it

How deep it goes
Defines the alternative handler mechanism and contrasts termination effects, but does not develop implementation internals.
Examples
Shows function-handler registration and declarations for quick_exit, _Exit, and abort.
What you can do after
Apply quick_exit with at_quick_exit when expedited termination is required.
How it connects
Connects quick_exit with at_quick_exit, atexit, _Exit, and abort.

Also explained in

Compare how 2 books explain quick_exit →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Modern C. The section links point to the parts of the book it draws on.