Add _Fork().
POSIX issue 8 function, already in musl/glibc (but not iOS/macOS).
Bug: https://austingroupbugs.net/view.php?id=62
Test: treehugger
Change-Id: Id51611afdab92dff36a540b7d8737fc0e31f3d36
diff --git a/libc/bionic/fork.cpp b/libc/bionic/fork.cpp
index d432c6d..615e81f 100644
--- a/libc/bionic/fork.cpp
+++ b/libc/bionic/fork.cpp
@@ -50,11 +50,13 @@
return result;
}
+int _Fork() {
+ return __clone_for_fork();
+}
+
int fork() {
__bionic_atfork_run_prepare();
-
- int result = __clone_for_fork();
-
+ int result = _Fork();
if (result == 0) {
// Disable fdsan and fdtrack post-fork, so we don't falsely trigger on processes that
// fork, close all of their fds, and then exec.