vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

exit.c (367B)


      1 
      2 #include <stdlib.h>
      3 #include <unistd.h>
      4 
      5 
      6 static void noop(void) { }
      7 
      8 void (*__exit_flush)(void) = noop;	// flush stdio streams on exit
      9 void (*__exit_atexit)(void) = noop;	// call atexit handlers on exit
     10 
     11 void exit(int status)
     12 {
     13 	// Call all atexit handlers
     14 	__exit_atexit();
     15 
     16 	// Flush stdio streams
     17 	__exit_flush();
     18 
     19 	// Hard-exit to the parent
     20 	_exit(status);
     21 }
     22