100bf4279Sespie /* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */ 200bf4279Sespie /* This function is in the public domain. --Mike Stump. */ 300bf4279Sespie 49588ddcfSespie /* 59588ddcfSespie 69588ddcfSespie @deftypefn Supplemental int atexit (void (*@var{f})()) 79588ddcfSespie 89588ddcfSespie Causes function @var{f} to be called at exit. Returns 0. 99588ddcfSespie 109588ddcfSespie @end deftypefn 119588ddcfSespie 129588ddcfSespie */ 139588ddcfSespie 1400bf4279Sespie #include "config.h" 1500bf4279Sespie 1600bf4279Sespie #ifdef HAVE_ON_EXIT 1700bf4279Sespie 1800bf4279Sespie int atexit(void (* f)(void))19*20fce977Smiodatexit(void (*f)(void)) 2000bf4279Sespie { 2100bf4279Sespie /* If the system doesn't provide a definition for atexit, use on_exit 2200bf4279Sespie if the system provides that. */ 2300bf4279Sespie on_exit (f, 0); 2400bf4279Sespie return 0; 2500bf4279Sespie } 2600bf4279Sespie 2700bf4279Sespie #endif 28