]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Use tgkill instead of tkill if it is available. This is the newer and
authorTom Hughes <tom@compton.nu>
Mon, 18 Oct 2004 18:56:25 +0000 (18:56 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 18 Oct 2004 18:56:25 +0000 (18:56 +0000)
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

coregrind/vg_mylibc.c

index ce861e2311f58d511468d2d3a500a6606629f92c..71b19bab260ce7d188ba166121b1f73bcef002cf 100644 (file)
@@ -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)