Make tkill() compatible with FC6+.
[debugger.git] / testsuite.c
index c3a2c43..306bc1d 100644 (file)
@@ -5,10 +5,11 @@
 #include <assert.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <linux/unistd.h>
+#include <unistd.h>
 #include <limits.h>
 #include <string.h>
 #include <pthread.h>
+#include <sys/syscall.h>
 
 #include "debugger.h"
 
@@ -16,8 +17,7 @@
 #include "debugger.c"
 
 
-_syscall2(int, tkill, int, tid, int, sig)
-int tkill(int tid, int sig);
+#define tkill(tid, sig) syscall (SYS_tkill, (tid), (sig))
 
 
 static int attach_checked (pid_t pid, int redelivered_expect)
@@ -86,7 +86,11 @@ static void registry_atexit (void)
   struct registry *iter;
 
   for (iter = registry_list; iter != NULL; iter = iter->next)
-    kill (iter->pid, SIGKILL);
+    {
+      tkill (iter->pid, SIGCONT);
+      tkill (iter->pid, SIGKILL);
+      kill (iter->pid, SIGKILL);
+    }
 }
 
 static void registry_cleanup (void)