[Bug 219947] Undocumented EAGAIN behavior for clone/pthread_create

bugzilla-daemon
2025-03-28T19:44:52Z

Alejandro Colomar (alx@kernel.org) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |alx@kernel.org

--- Comment #3 from Alejandro Colomar (alx@kernel.org) ---
(In reply to Carlos O'Donell from comment #2)
> 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.

Would you mind sending the patch to the mailing list, with a commit message
(i.e., full output of git-format-patch(1))?