12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #include <errno.h>
- #include <signal.h>
- #include <pthreadP.h>
- #include <tls.h>
- #include <sysdep.h>
- #include <bits/kernel-features.h>
- int
- __pthread_kill (
- pthread_t threadid,
- int signo)
- {
- struct pthread *pd = (struct pthread *) threadid;
-
- if (DEBUGGING_P && INVALID_TD_P (pd))
-
- return ESRCH;
-
- pid_t tid = atomic_forced_read (pd->tid);
- if (__builtin_expect (tid <= 0, 0))
-
- return ESRCH;
-
- if (signo == SIGCANCEL || signo == SIGTIMER || signo == SIGSETXID)
- return EINVAL;
-
- INTERNAL_SYSCALL_DECL (err);
-
- int val;
- val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
- tid, signo);
- return (INTERNAL_SYSCALL_ERROR_P (val, err)
- ? INTERNAL_SYSCALL_ERRNO (val, err) : 0);
- }
- strong_alias (__pthread_kill, pthread_kill)
|