[Bug 219947] Undocumented EAGAIN behavior for clone/pthread_create

bugzilla-daemon
2025-03-28T18:37:06Z

--- Comment #2 from Carlos O'Donell (carlos@redhat.com) ---
Example:

diff --git a/man/man3/pthread_create.3 b/man/man3/pthread_create.3
index 22926990e..ecb08b8e2 100644
--- a/man/man3/pthread_create.3
+++ b/man/man3/pthread_create.3
@@ -126,6 +126,12 @@ or the maximum number of PIDs,
was reached (see
.BR proc (5)).
.TP
+.B EAGAIN
+An in-progress kernel operation is preventing the creation of the
+thread, e.g.
+.BR execve (2),
+but if such an operation fails, the thread creation can be retried.
+.TP
.B EINVAL
Invalid settings in
.IR attr .
---

Note that I'm not saying that the kernel implementation is right or wrong. I
think it's an open design question if you should block, or return EAGAIN. Each
has pros and cons.