summaryrefslogtreecommitdiff
path: root/libpthread
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-09-26 09:53:37 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-09-26 09:53:37 +0200
commit8fb9dbf08043e5783f1e0680655af04ecf9888cb (patch)
tree6c63dbb5b09dcdad106b71b686d17ed998703a12 /libpthread
parentbd215ef170fb85b7572b617dacdeab26edd3d21c (diff)
linuxthreads: use tkill syscall for raise
Seems better and more stable.
Diffstat (limited to 'libpthread')
-rw-r--r--libpthread/linuxthreads/signals.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libpthread/linuxthreads/signals.c b/libpthread/linuxthreads/signals.c
index d8dbc78bd..0c0f2b6b1 100644
--- a/libpthread/linuxthreads/signals.c
+++ b/libpthread/linuxthreads/signals.c
@@ -17,6 +17,7 @@
#include <errno.h>
#include <signal.h>
#include <stdio.h>
+#include <sys/syscall.h>
#include "pthread.h"
#include "internals.h"
#include "spinlock.h"
@@ -233,14 +234,13 @@ int sigwait(const sigset_t * set, int * sig)
/* Redefine raise() to send signal to calling thread only,
as per POSIX 1003.1c */
libpthread_hidden_proto(raise)
-int raise (int sig)
-{
- int retcode = pthread_kill(pthread_self(), sig);
- if (retcode == 0)
- return 0;
- else {
- errno = retcode;
- return -1;
- }
+int raise (int sig) {
+ int ret;
+ pid_t tid;
+
+ tid = INLINE_SYSCALL(gettid, 0);
+ ret = INLINE_SYSCALL(tkill, 2, tid, sig);
+
+ return ret;
}
libpthread_hidden_def(raise)