atexit.c 231 B

1234567891011121314151617
  1. /* $Id$ */
  2. #include <stdlib.h>
  3. #define NEXITS 32
  4. extern void (*__functab[NEXITS])(void);
  5. extern int __funccnt;
  6. int
  7. atexit(void (*func)(void))
  8. {
  9. if (__funccnt >= NEXITS)
  10. return 1;
  11. __functab[__funccnt++] = func;
  12. return 0;
  13. }