18 years ago rsc
add exitcode
20 years ago rsc
so that the c library atexit handlers get a chance to run.
Various additions and fixes.