diff options
Diffstat (limited to 'main/uclibc/uclibc-fork-hook.diff')
-rw-r--r-- | main/uclibc/uclibc-fork-hook.diff | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/main/uclibc/uclibc-fork-hook.diff b/main/uclibc/uclibc-fork-hook.diff new file mode 100644 index 000000000..012691883 --- /dev/null +++ b/main/uclibc/uclibc-fork-hook.diff @@ -0,0 +1,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 |