summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2017-06-14 20:23:45 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2017-06-14 20:23:45 +0000
commit43977f09b303d24d85d61c6d195f4517f6c5ecef (patch)
tree0bd2d8d43e2f65eece4400de14b3b4defbfb0bde
parent2d5a4c1c2f160534cd59ec9bd0504219263116e3 (diff)
downloadgcompat-43977f09b303d24d85d61c6d195f4517f6c5ecef.tar.gz
gcompat-43977f09b303d24d85d61c6d195f4517f6c5ecef.tar.bz2
gcompat-43977f09b303d24d85d61c6d195f4517f6c5ecef.tar.xz
gcompat-43977f09b303d24d85d61c6d195f4517f6c5ecef.zip
pthread: add __register_atfork() stub
-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")));