source: rtems/cpukit/libcsupport/src/newlibc_exit.c @ e02d5dd9

4.115
Last change on this file since e02d5dd9 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1002 bytes
Line 
1/*
2 *  COPYRIGHT (c) 1994 by Division Incorporated
3 *
4 *  The license and distribution terms for this file may be
5 *  found in the file LICENSE in this distribution or at
6 *  http://www.rtems.org/license/LICENSE.
7 *
8 */
9
10#if HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <rtems.h>
15
16#if defined(RTEMS_NEWLIB)
17#include <rtems/libio.h>
18
19#include <stdio.h>
20#include <unistd.h>
21
22/* FIXME: These defines are a blatant hack */
23
24  #if defined(__USE_INIT_FINI__)
25    #if defined(__m32r__)
26      #define FINI_SYMBOL __fini
27    #elif defined(__ARM_EABI__)
28      #define FINI_SYMBOL __libc_fini_array
29    #else
30      #define FINI_SYMBOL _fini
31    #endif
32
33    extern void FINI_SYMBOL( void );
34  #endif
35
36void _exit(int status)
37{
38  /*
39   *  If the toolset uses init/fini sections, then we need to
40   *  run the global destructors now.
41   */
42  #if defined(FINI_SYMBOL)
43    FINI_SYMBOL();
44  #endif
45
46  (*rtems_libio_exit_helper)();
47  rtems_shutdown_executive(status);
48  for (;;) ; /* to avoid warnings */
49}
50
51#endif
Note: See TracBrowser for help on using the repository browser.