[Bug 219947] Undocumented EAGAIN behavior for clone/pthread_create

bugzilla-daemon
2025-03-28T18:28:39Z

Carlos O'Donell (carlos@redhat.com) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |carlos@redhat.com

--- Comment #1 from Carlos O'Donell (carlos@redhat.com) ---
Error number EGAIN is the best error return code for this scenario, from among
those that pthread_create() can return.

The in-progress execve() could fail, at which point pthread_create() called
again would succeed.

It deserves documenting that pthread_create() could fail with EAGAIN if an
in-progress execve() is making forward-progress ahead of the thread, but could
fail, in which case the thread could be created later.