ref: e35f62c0d85e159724d30189d0d266ffeb94b9a8
dir: /sys/src/ape/lib/ap/stdio/atexit.c/
#include <unistd.h>
#define	NONEXIT	34
extern int (*_atexitfns[NONEXIT])(void);
int
atexit(int (*f)(void))
{
	int i;
	for(i=0; i<NONEXIT; i++)
		if(!_atexitfns[i]){
			_atexitfns[i] = f;
			return(0);
		}
	return(1);
}