Subject: Re: proposed fix for pthread_kill() of a zombie thread.
To: Chuck Silvers <>
From: Nathan J. Williams <>
List: tech-userlevel
Date: 10/09/2005 17:24:22
Chuck Silvers <> writes:

> > thread. The pthread_suspend_np() function probably doesn't need this
> > level of safety.
> ok.  I guess pthread_suspend_np() isn't part of the standard?
> at least, I couldn't find it at

Nope, the "_np" is supposed to signify "non-portable".

> pthread_cancel() is supposed to do the ESRCH thing, I'll fix that.

No, pthread_cancel()'s return value of ESRCH is only listed under "may
fail", not "shall fail" in SUSv3. The use of "may fail" just means that
*if* the implementation detects that problem, then it has to use that
error code - but an implementation is not required to detect the
condition. Contrast the text in the "Errors" section of
pthread_cancel() with that of pthread_join(), for example.

        - Nathan