Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. #include <stdlib.h>
  3. #include <libc/atexit.h>
  4.  
  5. int
  6. atexit(void (*a)(void))
  7. {
  8.   struct __atexit *ap;
  9.   if (a == 0)
  10.     return -1;
  11.   ap = (struct __atexit *)malloc(sizeof(struct __atexit));
  12.   if (!ap)
  13.     return -1;
  14.   ap->__next = __atexit_ptr;
  15.   ap->__function = a;
  16.   __atexit_ptr = ap;
  17.   return 0;
  18. }
  19.