ack/lang/cem/libcc.ansi/stdlib/atexit.c

17 lines
231 B
C
Raw Normal View History

1994-06-24 14:02:31 +00:00
/* $Id$ */
1989-12-18 15:14:14 +00:00
2018-06-21 20:33:47 +00:00
#include <stdlib.h>
1989-12-18 15:14:14 +00:00
2018-06-21 20:33:47 +00:00
#define NEXITS 32
1989-12-18 15:14:14 +00:00
extern void (*__functab[NEXITS])(void);
extern int __funccnt;
2018-06-21 20:33:47 +00:00
int atexit(void (*func)(void))
1989-12-18 15:14:14 +00:00
{
if (__funccnt >= NEXITS)
return 1;
__functab[__funccnt++] = func;
return 0;
}