home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / libio-4.6.26 / cleanup.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-10  |  793 b   |  42 lines

  1. #include "libioP.h"
  2.  
  3. #ifdef HAVE_GNU_LD
  4.  
  5. #include "stdio.h"
  6. #include <unistd.h>
  7. #include <ansidecl.h>
  8. #include <gnu-stabs.h>
  9.  
  10. #if 1
  11. function_alias(_cleanup, _IO_cleanup, void, (),
  12.         DEFUN_VOID(_cleanup))
  13. #else
  14. /* We don't want this since we are building the shared library.
  15.  * We want the shared library selfcontained. __libc_atexit will
  16.  * ruin it unless we take exit () out of the shared library.
  17.  */
  18. text_set_element(__libc_atexit, _IO_cleanup);
  19. #endif
  20.  
  21. #else
  22.  
  23. #if !defined (__linux__)
  24.  
  25. #if _G_HAVE_ATEXIT
  26. #include <stdlib.h>
  27.  
  28. typedef void (*voidfunc) __P((void));
  29.  
  30. static void _IO_register_cleanup ()
  31. {
  32.   atexit ((voidfunc)_IO_cleanup);
  33.   _IO_cleanup_registration_needed = 0;
  34. }
  35.  
  36. void (*_IO_cleanup_registration_needed)() = _IO_register_cleanup;
  37. #endif /* _G_HAVE_ATEXIT */
  38.  
  39. #endif
  40.  
  41. #endif
  42.