diff options
author | 2007-09-03 14:40:16 +0000 | |
---|---|---|
committer | 2007-09-03 14:40:16 +0000 | |
commit | 5198527c0e2957645fda7040dfcb34da8197dcbd (patch) | |
tree | 0b140144618ef8fbe4bb1dcc3bf8af81c3ffd235 /lib/libc/stdlib/atexit.h | |
parent | Add ENOMSG and EIDRM; from jsg@ (diff) | |
download | wireguard-openbsd-5198527c0e2957645fda7040dfcb34da8197dcbd.tar.xz wireguard-openbsd-5198527c0e2957645fda7040dfcb34da8197dcbd.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 'lib/libc/stdlib/atexit.h')
-rw-r--r-- | lib/libc/stdlib/atexit.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/libc/stdlib/atexit.h b/lib/libc/stdlib/atexit.h index 21b0c2e5327..1b23565dd06 100644 --- a/lib/libc/stdlib/atexit.h +++ b/lib/libc/stdlib/atexit.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atexit.h,v 1.6 2003/07/31 07:08:42 deraadt Exp $ */ +/* $OpenBSD: atexit.h,v 1.7 2007/09/03 14:40:16 millert Exp $ */ /* * Copyright (c) 2002 Daniel Hartmeier @@ -34,8 +34,18 @@ struct atexit { struct atexit *next; /* next in list */ int ind; /* next index in this table */ int max; /* max entries >= ATEXIT_SIZE */ - void (*fns[1])(void); /* the table itself */ + struct atexit_fn { + union { + void (*std_func)(void); + void (*cxa_func)(void *); + } fn_ptr; + void *fn_arg; /* argument for CXA callback */ + void *fn_dso; /* shared module handle */ + } fns[1]; /* the table itself */ }; extern int __atexit_invalid; extern struct atexit *__atexit; /* points to head of LIFO stack */ + +int __cxa_atexit(void (*)(void *), void *, void *); +void __cxa_finalize(void *); |