X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_kill.c;h=3d9395cb7e0a0b5797c962e4af2d22d95de93718;hb=c0058ab465e950c2c3302d2b62e21cc0b494224b;hp=9d85fa5b497fb06afcabf9d1258cc8e446b3dabd;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c index 9d85fa5b..3d9395cb 100644 --- a/src/thread/pthread_kill.c +++ b/src/thread/pthread_kill.c @@ -1,7 +1,12 @@ -#define SYSCALL_RETURN_ERRNO #include "pthread_impl.h" +#include "lock.h" int pthread_kill(pthread_t t, int sig) { - return syscall3(__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; }