Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:15

0001 /*
0002  *  COPYRIGHT (c) 1994 by Division Incorporated
0003  *
0004  *  The license and distribution terms for this file may be
0005  *  found in the file LICENSE in this distribution or at
0006  *  http://www.rtems.org/license/LICENSE.
0007  *
0008  */
0009 
0010 #ifdef HAVE_CONFIG_H
0011 #include "config.h"
0012 #endif
0013 
0014 #include <rtems.h>
0015 
0016 #if defined(RTEMS_NEWLIB)
0017 #include <stdio.h>
0018 #include <unistd.h>
0019 
0020   #if defined(__USE_INIT_FINI__)
0021     #if CPU_USE_LIBC_INIT_FINI_ARRAY == TRUE
0022       #define FINI_SYMBOL __libc_fini_array
0023     #else
0024       #define FINI_SYMBOL _fini
0025     #endif
0026 
0027     extern void FINI_SYMBOL( void );
0028   #endif
0029 
0030 void _exit(int status)
0031 {
0032   /*
0033    *  If the toolset uses init/fini sections, then we need to
0034    *  run the global destructors now.
0035    */
0036   #if defined(FINI_SYMBOL)
0037     FINI_SYMBOL();
0038   #endif
0039 
0040   rtems_shutdown_executive(status);
0041   /* does not return */
0042 }
0043 
0044 #endif