scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

exit.c (197B)


      1 #include <stdlib.h>
      2 
      3 #include "../libc.h"
      4 
      5 #undef exit
      6 
      7 void (*_exitf[_ATEXIT_MAX])(void);
      8 unsigned _exitn;
      9 
     10 void
     11 exit(int status)
     12 {
     13 	while (_exitn > 0)
     14 		(*_exitf[--_exitn])();
     15 
     16 	_Exit(status);
     17 }