Defined in rt_misc.h, the __rt_exit() function shuts down the library but does not call functions registered with atexit().
atexit()-registered functions are called by exit().
The __rt_exit() function is not part of the C library standard, but the ARM C library supports it as an extension.
void __rt_exit(int code);
Where code is not used by the standard function.
Shuts down the C library by calling __rt_lib_shutdown(), and then calls _sys_exit() to terminate the application. Reimplement _sys_exit() rather than __rt_exit().
This function does not return.