diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-12-18 20:44:51 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014-12-18 20:44:51 -0500 |
commit | 7d3512126db7044525cf402255e0a85ac68dc2e9 (patch) | |
tree | 19e673df22f74feaf290bf8437d9df56bba19161 /src | |
parent | 0f859fc99325bbb25d506b28565e4a7385ffe0e6 (diff) | |
download | musl-7d3512126db7044525cf402255e0a85ac68dc2e9.tar.gz |
use tkill instead of tgkill in implementing raise
this shaves off a useless syscall for getting the caller's pid and
brings raise into alignment with other functions which were adapted to
use tkill rather than tgkill.
commit 83dc6eb087633abcf5608ad651d3b525ca2ec35e documents the
rationale for this change, and in particular why the tgkill syscall is
useless for its designed purpose of avoiding races.
Diffstat (limited to 'src')
-rw-r--r-- | src/signal/raise.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/signal/raise.c b/src/signal/raise.c index 35063c5b..717b1c91 100644 --- a/src/signal/raise.c +++ b/src/signal/raise.c @@ -5,12 +5,11 @@ int raise(int sig) { - int pid, tid, ret; + int tid, ret; sigset_t set; __block_app_sigs(&set); tid = __syscall(SYS_gettid); - pid = __syscall(SYS_getpid); - ret = syscall(SYS_tgkill, pid, tid, sig); + ret = syscall(SYS_tkill, tid, sig); __restore_sigs(&set); return ret; } |