Plan 9 from Bell Labs’s /usr/web/sources/plan9/sys/src/ape/lib/ap/stdio/atexit.c
#include <unistd.h> #define NONEXIT 34 extern void (*_atexitfns[NONEXIT])(void); int atexit(void (*f)(void)) { int i; for(i=0; i<NONEXIT; i++) if(!_atexitfns[i]){ _atexitfns[i] = f; return(0); } return(1); }