summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/exit.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-08-20 11:58:23 +0000
committerkib <kib@FreeBSD.org>2016-08-20 11:58:23 +0000
commit7e8bea05408ed1f02197d608373ffc7177e60d80 (patch)
treebb35a7941f2cabd9c18542aa9b2c05ea142afd47 /lib/libc/stdlib/exit.c
parent1fab140878f2c0fbe5801a4a7bb0549d15f23343 (diff)
downloadFreeBSD-src-7e8bea05408ed1f02197d608373ffc7177e60d80.zip
FreeBSD-src-7e8bea05408ed1f02197d608373ffc7177e60d80.tar.gz
MFC r303795:
Add __cxa_thread_atexit(3) API implementation.
Diffstat (limited to 'lib/libc/stdlib/exit.c')
-rw-r--r--lib/libc/stdlib/exit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c
index a656e04..521d05a 100644
--- a/lib/libc/stdlib/exit.c
+++ b/lib/libc/stdlib/exit.c
@@ -63,6 +63,12 @@ exit(int status)
_thread_autoinit_dummy_decl = 1;
+ /*
+ * We're dealing with cleaning up thread_local destructors in the case of
+ * the process termination through main() exit.
+ * Other cases are handled elsewhere.
+ */
+ __cxa_thread_call_dtors();
__cxa_finalize(NULL);
if (__cleanup)
(*__cleanup)();
OpenPOWER on IntegriCloud