diff options
Diffstat (limited to 'sysdeps/posix/raise.c')
-rw-r--r-- | sysdeps/posix/raise.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sysdeps/posix/raise.c b/sysdeps/posix/raise.c index 9fdb4d538b..4806c0cc63 100644 --- a/sysdeps/posix/raise.c +++ b/sysdeps/posix/raise.c @@ -16,13 +16,20 @@ <https://www.gnu.org/licenses/>. */ #include <signal.h> -#include <unistd.h> +#include <errno.h> +#include <pthread.h> /* Raise the signal SIG. */ int raise (int sig) { - return __kill (__getpid (), sig); + int ret = __pthread_kill (__pthread_self (), sig); + if (ret != 0) + { + __set_errno (ret); + ret = -1; + } + return ret; } libc_hidden_def (raise) weak_alias (raise, gsignal) |