Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / stdlib / cxa_atexit.c
blobae2d21a605b91edca67b0991a27a79ec8e088e0e
1 /*
2 * Implementation of __cxa_atexit.
3 */
5 #include <stddef.h>
6 #include <stdlib.h>
7 #include <reent.h>
8 #include <sys/lock.h>
9 #include "atexit.h"
11 #ifdef _REENT_SMALL
13 #include "on_exit_args.h"
15 /* force linking of static instance of _on_exit_args */
16 const void * const __cxa_atexit_dummy = &__on_exit_args;
18 #endif /* def _REENT_SMALL */
21 * Register a function to be performed at exit or DSO unload.
24 int
25 __cxa_atexit (void (*fn) (void *),
26 void *arg,
27 void *d)
29 #ifdef _LITE_EXIT
30 /* Refer to comments in __atexit.c for more details of lite exit. */
31 int __register_exitproc (int, void (*fn) (void), void *, void *)
32 __attribute__ ((weak));
34 if (!__register_exitproc)
35 return 0;
36 else
37 #endif
38 return __register_exitproc (__et_cxa, (void (*)(void)) fn, arg, d);