Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between exit and quick_exit

Tags:

c

c11

What are the differences between void quick_exit( int exit_code ) which was included in c11 standard and void exit( int exit_code ) function that already existed before c11 standard?

like image 678
coder Avatar asked Dec 07 '22 21:12

coder


1 Answers

exit ensures that stream buffers are flushed, closed, etc. Such behavior for quick_exit is not specified by the standard.

With these you can define two ways of quitting an application, one that lets you terminates with full cleaning (made by functions registered with atexit), and the other to let applications terminate more quickly without cleaning too much things (calls to functions registered with at_quick_exit).

like image 130
Jean-Baptiste Yunès Avatar answered Dec 10 '22 09:12

Jean-Baptiste Yunès