Merge "_Fork(): clarify what not running pthread_atfork() handlers means in practice." into main am: 69bc81615b
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2987030
Change-Id: Ic3bcc3ec2addc60edf75d612eb4c5bd35f902040
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index b94197e..ee772a5 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -89,7 +89,11 @@
/**
* _Fork() creates a new process. _Fork() differs from fork() in that it does
- * not run any handlers set by pthread_atfork().
+ * not run any handlers set by pthread_atfork(). In addition to any user-defined
+ * ones, bionic uses pthread_atfork() handlers to ensure consistency of its own
+ * state, so the child should only call
+ * [POSIX async-safe](https://man7.org/linux/man-pages/man7/signal-safety.7.html)
+ * functions.
*
* Returns 0 in the child, the pid of the child in the parent,
* and returns -1 and sets `errno` on failure.