133965Sjdp/* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
233965Sjdp/* This function is in the public domain.  --Mike Stump. */
333965Sjdp
489857Sobrien/*
589857Sobrien
689857Sobrien@deftypefn Supplemental int atexit (void (*@var{f})())
789857Sobrien
889857SobrienCauses function @var{f} to be called at exit.  Returns 0.
989857Sobrien
1089857Sobrien@end deftypefn
1189857Sobrien
1289857Sobrien*/
1389857Sobrien
1460484Sobrien#include "config.h"
1560484Sobrien
1660484Sobrien#ifdef HAVE_ON_EXIT
1760484Sobrien
1833965Sjdpint
19218822Sdimatexit(void (*f)(void))
2033965Sjdp{
2133965Sjdp  /* If the system doesn't provide a definition for atexit, use on_exit
2233965Sjdp     if the system provides that.  */
2333965Sjdp  on_exit (f, 0);
2433965Sjdp  return 0;
2533965Sjdp}
2660484Sobrien
2733965Sjdp#endif
28