xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/gnulib-lib/atexit.c (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1*946379e7Schristos /* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
2*946379e7Schristos /* This function is in the public domain.  --Mike Stump. */
3*946379e7Schristos 
4*946379e7Schristos #include <config.h>
5*946379e7Schristos 
6*946379e7Schristos int
atexit(void (* f)(void))7*946379e7Schristos atexit (void (*f) (void))
8*946379e7Schristos {
9*946379e7Schristos   /* If the system doesn't provide a definition for atexit, use on_exit
10*946379e7Schristos      if the system provides that.  */
11*946379e7Schristos   on_exit (f, 0);
12*946379e7Schristos   return 0;
13*946379e7Schristos }
14