Make the minimum implementation of pthread_kill conform to the
functionality spelled out in SUSv3. o Signal of 0 means do everything except send the signal o Check that the signal is not invalid o Check that the target thread is not dead/invalid
This commit is contained in:
parent
7d2c70ccb6
commit
1e599449cf
@ -75,9 +75,22 @@ __weak_reference(_pthread_kill, pthread_kill);
|
||||
int
|
||||
_pthread_kill(pthread_t pthread, int sig)
|
||||
{
|
||||
int error;
|
||||
|
||||
if (sig < 0 || sig > NSIG)
|
||||
return (EINVAL);
|
||||
if (_thread_initial == NULL)
|
||||
_thread_init();
|
||||
error = _find_thread(pthread);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
/*
|
||||
* A 0 signal means do error-checking but don't send signal.
|
||||
*/
|
||||
if (sig == 0)
|
||||
return (0);
|
||||
|
||||
return (thr_kill(pthread->thr_id, sig));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user