We are writing an Android application, with mixed C and Java parts, mainly used to contain and control an external Java VM. And we need to somehow catch the moment when the VM decides to call exit() without modifying the VM or forking the process (because we also need some way to acess an OpenGL ES context). atexit call can't give us a response with the error code, which is not good. Is there any other way (maybe bionic-exclusive) to accomplish this?