exitensures that stream buffers are flushed, closed, etc. This behavior is quick_exitnot specified by the standard.
Using these tools, you can determine two ways to exit the application: one that allows you to complete the full cleanup (performed by functions registered with atexit), and the other so that applications finish faster without reading too many things (calls to functions registered in at_quick_exit).