Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Function registered with atexit() not getting called

Is it guaranteed that a function registered with atexit will ALWAYS be called upon normal program termination? (I encounterd a scenario in FreeBSD where a function that I register with atexit never gets called, even when the program terminates normally).

like image 988
Raj Avatar asked Jun 11 '26 10:06

Raj


1 Answers

No. First, the function will not be called if atexit returns a non-0 value. Secondly, it won't be called if a function registered before it doesn't return normally.

like image 186
James Kanze Avatar answered Jun 13 '26 23:06

James Kanze



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!