summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/exit.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-08-20 12:26:44 +0000
committerkib <kib@FreeBSD.org>2016-08-20 12:26:44 +0000
commit8ef9c6fc5bcfe1b606229a8da024f76b2d5048c1 (patch)
treed3fb002a2880118eca23542ae9c97773beee2367 /lib/libc/stdlib/exit.c
parent2e9b1dc197dd198d7379e4a4f79a80cbcf43a1ee (diff)
downloadFreeBSD-src-8ef9c6fc5bcfe1b606229a8da024f76b2d5048c1.zip
FreeBSD-src-8ef9c6fc5bcfe1b606229a8da024f76b2d5048c1.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 145eb9d..b8afede 100644
--- a/lib/libc/stdlib/exit.c
+++ b/lib/libc/stdlib/exit.c
@@ -64,6 +64,12 @@ exit(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