| |||
| Home > The C and C++ Libraries > Tailoring error signaling, error handling, and program exit > _sys_exit() | |||
The library exit function. All exits from the library eventually
call _sys_exit().
This function must not return. You can intercept application exit at a higher level by either:
Implementing
the C library function exit() as part of your
application. You lose atexit() processing and
library shutdown if you do this.
Implementing the function __rt_exit(int
n) as part of your application. You lose library shutdown
if you do this, but atexit() processing is
still performed when exit() is called or main() returns.
This function is called if a stack overflow occurs. If you
re-implement this function and include a stack check as part of
the code, the overflow causes an immediate return to _sys_exit() causing
a worse stack overflow. It is not recommended that this function performs
stack checking.