diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-09-12 00:06:38 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-09-12 00:06:38 +0200 |
commit | a9d69ae8ab389dc9f47aef519dac4f422b4120ef (patch) | |
tree | f1876a3958e4a3f7146c558364e5964fc20d8581 | |
parent | cd491a12ef1cfdb5e8c736f25f79a4183b5c9933 (diff) | |
parent | 5b6b6eb6276af8acb40bd62d28f18b1c3003e5a1 (diff) |
Merge branch 'master-glibc-2.22' into master-glibc-2.23
-rw-r--r-- | Versions | 1 | ||||
-rw-r--r-- | forward.c | 5 | ||||
-rw-r--r-- | sysdeps/generic/pt-atfork.c | 6 |
3 files changed, 10 insertions, 2 deletions
@@ -20,6 +20,7 @@ libc { GLIBC_PRIVATE { __libc_alloca_cutoff; __libc_pthread_init; + # TODO: expose this publicly __register_atfork; } } @@ -148,6 +148,7 @@ struct atfork { void (*prepare) (void); void (*parent) (void); void (*child) (void); + void *dso_handle; struct atfork *prev; struct atfork *next; }; @@ -220,7 +221,8 @@ int __register_atfork ( void (*prepare) (void), void (*parent) (void), - void (*child) (void)) + void (*child) (void), + void *dso_handle) { struct atfork *new = malloc (sizeof (*new)); if (!new) @@ -229,6 +231,7 @@ __register_atfork ( new->prepare = prepare; new->parent = parent; new->child = child; + new->dso_handle = dso_handle; new->prev = NULL; __mutex_lock (&atfork_lock); diff --git a/sysdeps/generic/pt-atfork.c b/sysdeps/generic/pt-atfork.c index ce72e10..304d7ef 100644 --- a/sysdeps/generic/pt-atfork.c +++ b/sysdeps/generic/pt-atfork.c @@ -20,10 +20,14 @@ #include <pthread.h> #include <pt-internal.h> +/* This is defined by newer gcc version unique for each module. */ +extern void *__dso_handle __attribute__ ((__weak__, + __visibility__ ("hidden"))); + int pthread_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void)) { - return __register_atfork (prepare, parent, child); + return __register_atfork (prepare, parent, child, &__dso_handle == NULL ? NULL : __dso_handle); } |