shithub: riscv

ref: 88ccea37f65b87312292b2b1a107c39927c6a2c3
dir: /sys/src/ape/lib/ap/stdio/atexit.c/

View raw version
#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);
}