diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-12-28 18:38:43 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-12-28 18:38:43 +0000 |
commit | d8c7beaa7aa5e4778ffa02e232478db3dc2f145a (patch) | |
tree | 2e98f9976f7f134463f717d3fe536963656be568 /lib/libc | |
parent | 61b165ffeabdb73d975f8798b2f5f8abc64fcb52 (diff) |
Move atexit(3) into crtbegin.c and certbeginS.c such that we can pass the
right __dso_handle and have dlopen'ed shared objects run their atexit handlers
when they get unloaded. This is what Linux does, and several ports depend on
this behaviour (and will crash upon exit without this chang).
Based on an earlier diff from matthew@
Tested by ajacoutot@
ok deraadt@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/shlib_version | 2 | ||||
-rw-r--r-- | lib/libc/stdlib/atexit.c | 11 |
2 files changed, 2 insertions, 11 deletions
diff --git a/lib/libc/shlib_version b/lib/libc/shlib_version index 396b3134567..0b2ee0d1ffd 100644 --- a/lib/libc/shlib_version +++ b/lib/libc/shlib_version @@ -1,4 +1,4 @@ -major=72 +major=73 minor=0 # note: If changes were made to include/thread_private.h or if system # calls were added/changed then librthread/shlib_version also be updated. diff --git a/lib/libc/stdlib/atexit.c b/lib/libc/stdlib/atexit.c index 52f1cf3c5c7..049da3261d8 100644 --- a/lib/libc/stdlib/atexit.c +++ b/lib/libc/stdlib/atexit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atexit.c,v 1.16 2013/06/02 21:08:36 matthew Exp $ */ +/* $OpenBSD: atexit.c,v 1.17 2013/12/28 18:38:42 kettenis Exp $ */ /* * Copyright (c) 2002 Daniel Hartmeier * All rights reserved. @@ -102,15 +102,6 @@ unlock: } /* - * Register a function to be performed at exit. - */ -int -atexit(void (*func)(void)) -{ - return (__cxa_atexit((void (*)(void *))func, NULL, NULL)); -} - -/* * Call all handlers registered with __cxa_atexit() for the shared * object owning 'dso'. * Note: if 'dso' is NULL, then all remaining handlers are called. |