diff options
author | millert <> | 2007-09-03 14:40:16 +0000 |
---|---|---|
committer | millert <> | 2007-09-03 14:40:16 +0000 |
commit | 7e0e6a2581ab1d1bca602865b8e38dfa2f54424a (patch) | |
tree | 276e35092c38431624dd4e601442d98afb2a617d /src/lib/libc/stdlib/atexit.h | |
parent | 2056049ed6b7a028e611838a742280fced6d2c23 (diff) | |
download | openbsd-7e0e6a2581ab1d1bca602865b8e38dfa2f54424a.tar.gz openbsd-7e0e6a2581ab1d1bca602865b8e38dfa2f54424a.tar.bz2 openbsd-7e0e6a2581ab1d1bca602865b8e38dfa2f54424a.zip |
Add __cxa_atexit() support for gcc3. This provides support for shared object destructors called at dlclose() time. Inspired by similar changes in FreeBSD and NetBSD.
Diffstat (limited to 'src/lib/libc/stdlib/atexit.h')
-rw-r--r-- | src/lib/libc/stdlib/atexit.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/atexit.h b/src/lib/libc/stdlib/atexit.h index 21b0c2e532..1b23565dd0 100644 --- a/src/lib/libc/stdlib/atexit.h +++ b/src/lib/libc/stdlib/atexit.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: atexit.h,v 1.6 2003/07/31 07:08:42 deraadt Exp $ */ | 1 | /* $OpenBSD: atexit.h,v 1.7 2007/09/03 14:40:16 millert Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2002 Daniel Hartmeier | 4 | * Copyright (c) 2002 Daniel Hartmeier |
@@ -34,8 +34,18 @@ struct atexit { | |||
34 | struct atexit *next; /* next in list */ | 34 | struct atexit *next; /* next in list */ |
35 | int ind; /* next index in this table */ | 35 | int ind; /* next index in this table */ |
36 | int max; /* max entries >= ATEXIT_SIZE */ | 36 | int max; /* max entries >= ATEXIT_SIZE */ |
37 | void (*fns[1])(void); /* the table itself */ | 37 | struct atexit_fn { |
38 | union { | ||
39 | void (*std_func)(void); | ||
40 | void (*cxa_func)(void *); | ||
41 | } fn_ptr; | ||
42 | void *fn_arg; /* argument for CXA callback */ | ||
43 | void *fn_dso; /* shared module handle */ | ||
44 | } fns[1]; /* the table itself */ | ||
38 | }; | 45 | }; |
39 | 46 | ||
40 | extern int __atexit_invalid; | 47 | extern int __atexit_invalid; |
41 | extern struct atexit *__atexit; /* points to head of LIFO stack */ | 48 | extern struct atexit *__atexit; /* points to head of LIFO stack */ |
49 | |||
50 | int __cxa_atexit(void (*)(void *), void *, void *); | ||
51 | void __cxa_finalize(void *); | ||