summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--libgcompat/pthread.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5d18d84..b6e497a 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@ LIBGCOMPAT_SRC = \
libgcompat/gnulib.c \
libgcompat/malloc.c \
libgcompat/math.c \
+ libgcompat/pthread.c \
libgcompat/resource.c \
libgcompat/setjmp.c \
libgcompat/stdio.c \
diff --git a/libgcompat/pthread.c b/libgcompat/pthread.c
new file mode 100644
index 0000000..9d061e9
--- /dev/null
+++ b/libgcompat/pthread.c
@@ -0,0 +1,7 @@
+#include <pthread.h>
+
+int __register_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)) {
+ return pthread_atfork(prepare, parent, child);
+}
+
+int register_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)) __attribute__ ((weak, alias("__register_atfork")));