summaryrefslogtreecommitdiffstats
path: root/main/uclibc/uclibc-fork-hook.diff
blob: 0126918836c2260b05dc5fb6ef51372d20487e32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c
index e15b99b..70c750d 100644
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c
+++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.c
@@ -20,6 +20,7 @@
 #include <errno.h>
 #include <fork.h>
 #include <bits/libc-lock.h>
+#include <internals.h>
 
 struct fork_block __fork_block =
 {
@@ -28,3 +29,12 @@ struct fork_block __fork_block =
   .parent_list = { &__fork_block.parent_list, &__fork_block.parent_list },
   .child_list = { &__fork_block.child_list, &__fork_block.child_list }
 };
+
+pid_t
+__libc_fork (void)
+{
+  return __libc_maybe_call2 (pthread_fork, (&__fork_block), ARCH_FORK ());
+}
+weak_alias (__libc_fork, __fork)
+libc_hidden_def (__fork)
+weak_alias (__libc_fork, fork)
diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h
index 85477eb..1e7379e 100644
--- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h
+++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h
@@ -54,5 +54,5 @@ extern int __register_atfork (void (*__prepare) (void),
 			      void *dso_handle);
 
 #ifndef ARCH_FORK
-# define ARCH_FORK() __libc_fork()
+# define ARCH_FORK() INLINE_SYSCALL (fork, 0)
 #endif