summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdlib/cxa_atexit.c
blob: 9b73372d6fd5ff327ff823dcd2a6494c57fcca0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * Implementation of __cxa_atexit.
 */

#include <stddef.h>
#include <stdlib.h>
#include <reent.h>
#include <sys/lock.h>
#include "atexit.h"

#ifdef __REENT_HAS_CXA_SUPPORT
/*
 * Register a function to be performed at exit or DSO unload.
 */

int
_DEFUN (__cxa_atexit,
	(fn, arg, d),
	void (*fn) (void *) _AND
	void *arg _AND
	void *d)
{
  return __register_exitproc (__et_cxa, (void (*)(void)) fn, arg, d);
}

#endif /* __REENT_HAS_CXA_SUPPORT */