Back to index

cell-binutils  2.17cvs20070401
atexit.c
Go to the documentation of this file.
00001 /* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
00002 /* This function is in the public domain.  --Mike Stump. */
00003 
00004 /*
00005 
00006 @deftypefn Supplemental int atexit (void (*@var{f})())
00007 
00008 Causes function @var{f} to be called at exit.  Returns 0.
00009 
00010 @end deftypefn
00011 
00012 */
00013 
00014 #include "config.h"
00015 
00016 #ifdef HAVE_ON_EXIT
00017 
00018 int
00019 atexit(void (*f)(void))
00020 {
00021   /* If the system doesn't provide a definition for atexit, use on_exit
00022      if the system provides that.  */
00023   on_exit (f, 0);
00024   return 0;
00025 }
00026 
00027 #endif