1 1.1 christos /* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */ 2 1.1 christos /* This function is in the public domain. --Mike Stump. */ 3 1.1 christos 4 1.1 christos /* 5 1.1 christos 6 1.1 christos @deftypefn Supplemental int atexit (void (*@var{f})()) 7 1.1 christos 8 1.1 christos Causes function @var{f} to be called at exit. Returns 0. 9 1.1 christos 10 1.1 christos @end deftypefn 11 1.1 christos 12 1.1 christos */ 13 1.1 christos 14 1.1 christos #include "config.h" 15 1.1 christos 16 1.1 christos #ifdef HAVE_ON_EXIT 17 1.1 christos 18 1.1 christos int 19 1.1 christos atexit(void (*f)(void)) 20 1.1 christos { 21 1.1 christos /* If the system doesn't provide a definition for atexit, use on_exit 22 1.1 christos if the system provides that. */ 23 1.1 christos on_exit (f, 0); 24 1.1 christos return 0; 25 1.1 christos } 26 1.1 christos 27 1.1 christos #endif 28