Subversion Repositories Kolibri OS

Rev

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

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <libc/stubs.h>
  3. #include <stdlib.h>
  4. #include <unistd.h>
  5. #include <fcntl.h>
  6. #include <dos.h>
  7. #include <io.h>
  8. #include <libc/atexit.h>
  9.  
  10. struct __atexit *__atexit_ptr = 0;
  11.  
  12. extern void (*__stdio_cleanup_hook)(void);
  13.  
  14. /* typedef void (*FUNC)(void);
  15. extern FUNC djgpp_first_dtor[] __asm__("djgpp_first_dtor");
  16. extern FUNC djgpp_last_dtor[] __asm__("djgpp_last_dtor"); */
  17.  
  18. int keypress_at_exit=0;
  19.  
  20. void exit(int status)
  21. {
  22.   int i;
  23.   struct __atexit *a = __atexit_ptr;
  24. //  dosemu_atexit();    // <- this function is already in atexit list
  25.                         // (see crt1.c). - diamond
  26. /*  if(keypress_at_exit) while(!__menuet__getkey()); */
  27.   while (a)
  28.   {
  29.     (a->__function)();
  30.     a = a->__next;
  31.   }
  32. /*  if (__stdio_cleanup_hook)
  33.     __stdio_cleanup_hook();
  34.    for (i=0; i<djgpp_last_dtor-djgpp_first_dtor; i++)
  35.     djgpp_first_dtor[i]();*/
  36.   _exit(status);
  37. }
  38.