Loading...
stdlib/FreeBSD/exit.c Libc-1158.1.2 Libc-825.26
--- Libc/Libc-1158.1.2/stdlib/FreeBSD/exit.c
+++ Libc/Libc-825.26/stdlib/FreeBSD/exit.c
@@ -41,17 +41,18 @@
 #include "atexit.h"
 #include "libc_private.h"
 
-#include <TargetConditionals.h>
-
 void (*__cleanup)(void);
-extern void __exit(int) __attribute__((noreturn));
-#if !TARGET_IPHONE_SIMULATOR && (__i386__ || __x86_64__)
-extern void _tlv_exit();
-#endif
+extern void __exit(int);
 
 /*
  * Exit, flushing stdio buffers if necessary.
  */
 void
-exit(int status)
+exit(status)
+	int status;
 {
+	__cxa_finalize(NULL);
+	if (__cleanup)
+		(*__cleanup)();
+	__exit(status);
+}