From: Tom Hughes Date: Mon, 18 Oct 2004 18:56:25 +0000 (+0000) Subject: Use tgkill instead of tkill if it is available. This is the newer and X-Git-Tag: svn/VALGRIND_3_0_0~1500 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7c957590400effc84db5055d1506faf135b488b;p=thirdparty%2Fvalgrind.git Use tgkill instead of tkill if it is available. This is the newer and safer kernel interface to signalling a particular thread and it ensures you can only send a signal to one of your own threads. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2795 --- diff --git a/coregrind/vg_mylibc.c b/coregrind/vg_mylibc.c index ce861e2311..71b19bab26 100644 --- a/coregrind/vg_mylibc.c +++ b/coregrind/vg_mylibc.c @@ -203,8 +203,13 @@ Int VG_(ktkill)( Int tid, Int signo ) { Int ret = -VKI_ENOSYS; +#ifdef __NR_tgkill + ret = VG_(do_syscall)(__NR_tgkill, VG_(main_pid), tid, signo); +#endif /* __NR_tgkill */ + #ifdef __NR_tkill - ret = VG_(do_syscall)(__NR_tkill, tid, signo); + if (ret == -VKI_ENOSYS) + ret = VG_(do_syscall)(__NR_tkill, tid, signo); #endif /* __NR_tkill */ if (ret == -VKI_ENOSYS)