aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2021-03-24 21:27:34 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-03-29 21:41:09 +0200
commit64786a7090d104a2e4e2e225b1eff08951fe008a (patch)
tree9498fe2a6f2504910df83a3c68c1307f3fb9f2ce /nptl
parente4fda4631017e49d4ee5a2755db34289b6860fa4 (diff)
downloadglibc-64786a7090d104a2e4e2e225b1eff08951fe008a.zip
glibc-64786a7090d104a2e4e2e225b1eff08951fe008a.tar.gz
glibc-64786a7090d104a2e4e2e225b1eff08951fe008a.tar.bz2
fork.h: replace with register-atfork.h
UNREGISTER_ATFORK is now defined for all ports in register-atfork.h, so most previous includes of fork.h actually only need register-atfork.h now, and cxa_finalize.c does not need an ifdef UNREGISTER_ATFORK any more. The nptl-specific fork generation counters can then go to pthreadP.h, and fork.h be removed. Checked on x86_64-linux-gnu and i686-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl')
-rw-r--r--nptl/libc_pthread_init.c2
-rw-r--r--nptl/nptl-init.c1
-rw-r--r--nptl/pthreadP.h6
-rw-r--r--nptl/pthread_atfork.c2
4 files changed, 8 insertions, 3 deletions
diff --git a/nptl/libc_pthread_init.c b/nptl/libc_pthread_init.c
index 0757f92..4de182b 100644
--- a/nptl/libc_pthread_init.c
+++ b/nptl/libc_pthread_init.c
@@ -18,7 +18,7 @@
#include <unistd.h>
#include <list.h>
-#include <fork.h>
+#include <register-atfork.h>
#include <dl-sysdep.h>
#include <tls.h>
#include <string.h>
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 865ee8d..2c7e222 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -29,7 +29,6 @@
#include <ldsodefs.h>
#include <tls.h>
#include <list.h>
-#include <fork.h>
#include <version.h>
#include <shlib-compat.h>
#include <lowlevellock.h>
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index c8538de..2653e0f 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -355,6 +355,12 @@ extern void __nptl_death_event (void);
hidden_proto (__nptl_create_event)
hidden_proto (__nptl_death_event)
+/* The fork generation counter, defined in libpthread. */
+extern unsigned long int __fork_generation attribute_hidden;
+
+/* Pointer to the fork generation counter in the thread library. */
+extern unsigned long int *__fork_generation_pointer attribute_hidden;
+
/* Register the generation counter in the libpthread with the libc. */
#ifdef TLS_MULTIPLE_THREADS_IN_TCB
extern void __libc_pthread_init (unsigned long int *ptr,
diff --git a/nptl/pthread_atfork.c b/nptl/pthread_atfork.c
index 097a86d..6398688 100644
--- a/nptl/pthread_atfork.c
+++ b/nptl/pthread_atfork.c
@@ -34,7 +34,7 @@
<https://www.gnu.org/licenses/>. */
#include "pthreadP.h"
-#include <fork.h>
+#include <register-atfork.h>
#include <dso_handle.h>