X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_kill.c;h=6d70e626daf40bdf8e60240fc1fbb1b561d377dd;hb=40bae2d32fd6f3ffea437fa745ad38a1fe77b27e;hp=17aa5c4bdba2dd2af3d7a2368e72b5c8e9b132ea;hpb=be82e122bf37fdcd1766d1ed220f0300b30ab6a3;p=musl diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c index 17aa5c4b..6d70e626 100644 --- a/src/thread/pthread_kill.c +++ b/src/thread/pthread_kill.c @@ -2,5 +2,10 @@ int pthread_kill(pthread_t t, int sig) { - return -__syscall(__NR_tgkill, t->pid, t->tid, sig); + int r; + LOCK(t->killlock); + r = t->tid ? -__syscall(SYS_tkill, t->tid, sig) + : (sig+0U >= _NSIG ? EINVAL : 0); + UNLOCK(t->killlock); + return r; }