...
The C99 exit()
function is used for normal program termination (see ERR04-C. Choose an appropriate termination strategy). Nested calls to exit()
result in undefined behavior (see also undefined behavior #172 in Annex J). This can only occur when exit()
is invoked from a function registered with atexit()
, or when exit()
is called from within a signal handler (see SIG30-C. Call only asynchronous-safe functions within signal handlers).
...