ref: 8604fd05150d98be7c9503ec9a97b63f05371ff7
dir: /src/libc/stdlib/atexit.c/
#include <stdlib.h> #include <errno.h> #include "../libc.h" #undef atexit int atexit(void (*fun)(void)) { if (_exitn == _ATEXIT_MAX) { errno = ENOMEM; return -1; } _exitf[_exitn++] = fun; return 0; }