summaryrefslogtreecommitdiff
path: root/lib/csu/crtbegin.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csu/crtbegin.c')
-rw-r--r--lib/csu/crtbegin.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/csu/crtbegin.c b/lib/csu/crtbegin.c
index e1ffc16bb1b..2917bd38260 100644
--- a/lib/csu/crtbegin.c
+++ b/lib/csu/crtbegin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crtbegin.c,v 1.18 2015/04/04 18:05:05 guenther Exp $ */
+/* $OpenBSD: crtbegin.c,v 1.19 2015/04/07 01:27:06 guenther Exp $ */
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
/*
@@ -91,6 +91,19 @@ atexit(void (*fn)(void))
return (__cxa_atexit((void (*)(void *))fn, NULL, NULL));
}
+/*
+ * 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, NULL));
+}
+asm(".weak pthread_atfork");
+
static const init_f __CTOR_LIST__[1]
__attribute__((section(".ctors"))) = { (void *)-1 }; /* XXX */