#include #include #define NEXIT 33 static void (*onex[NEXIT])(void); atexit(void (*f)(void)) { int i; for(i=0; i= 0; i--) if(f = onex[i]) { onex[i] = 0; (*f)(); } _exits(s); }