summaryrefslogtreecommitdiff
path: root/lib/csu/crtbeginS.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csu/crtbeginS.c')
-rw-r--r--lib/csu/crtbeginS.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/csu/crtbeginS.c b/lib/csu/crtbeginS.c
index 152bfa5ec79..f97d30f22b0 100644
--- a/lib/csu/crtbeginS.c
+++ b/lib/csu/crtbeginS.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crtbeginS.c,v 1.15 2015/04/04 18:05:05 guenther Exp $ */
+/* $OpenBSD: crtbeginS.c,v 1.16 2015/04/07 01:27:06 guenther Exp $ */
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
/*
@@ -80,6 +80,20 @@ atexit(void (*fn)(void))
}
asm(".hidden atexit");
+/*
+ * Ditto for pthread_atfork()
+ */
+int _thread_atfork(void (*)(void), void (*)(void), void (*)(void), void *)
+ __attribute__((weak));
+
+int
+pthread_atfork(void (*prep)(void), void (*parent)(void), void (*child)(void))
+{
+ return (_thread_atfork(prep, parent, child, &__dso_handle));
+}
+/* hppa doesn't permit directives in first column, so space after newline */
+asm(".hidden pthread_atfork\n .weak pthread_atfork");
+
static init_f __CTOR_LIST__[1]
__attribute__((section(".ctors"))) = { (void *)-1 }; /* XXX */