xref: /netbsd-src/external/gpl2/xcvs/dist/lib/atexit.c (revision c38e7cc395b1472a774ff828e46123de44c628e9)
1 /* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
2 /* This function is in the public domain.  --Mike Stump. */
3 #include <sys/cdefs.h>
4 __RCSID("$NetBSD: atexit.c,v 1.2 2016/05/17 14:00:09 christos Exp $");
5 
6 #ifdef HAVE_CONFIG_H
7 # include <config.h>
8 #endif
9 
10 int
11 atexit (void (*f) (void))
12 {
13   /* If the system doesn't provide a definition for atexit, use on_exit
14      if the system provides that.  */
15   on_exit (f, 0);
16   return 0;
17 }
18