]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add support for sys_tgkill (syscall 270), needed by tls gunk on
authorJulian Seward <jseward@acm.org>
Sun, 13 Mar 2005 18:02:51 +0000 (18:02 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 13 Mar 2005 18:02:51 +0000 (18:02 +0000)
x86-linux.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3341

coregrind/linux/core_os.h
coregrind/linux/syscalls.c
coregrind/x86-linux/syscalls.c

index b4b7f150c92e653e51c6f4709651c9e956a6f88d..d7553ea856183242e4e8d1cf545d7c2d187720fc 100644 (file)
@@ -82,6 +82,8 @@ LINUX_SYSCALL_WRAPPER(sys_epoll_create);
 LINUX_SYSCALL_WRAPPER(sys_epoll_ctl);
 LINUX_SYSCALL_WRAPPER(sys_epoll_wait);
 
+LINUX_SYSCALL_WRAPPER(sys_tgkill);
+
 LINUX_SYSCALL_WRAPPER(sys_io_setup);
 LINUX_SYSCALL_WRAPPER(sys_io_destroy);
 LINUX_SYSCALL_WRAPPER(sys_io_getevents);
index 507d17ef9bfff13cc17794a7088e1a6c7a187509..4b401bd1be0b706a7e7b0b909b75befb76ccca2d 100644 (file)
@@ -475,6 +475,25 @@ POST(sys_epoll_wait)
       POST_MEM_WRITE( ARG2, sizeof(struct epoll_event)*RES ) ;
 }
 
+PRE(sys_tgkill, 0)
+{
+   /* int tgkill(pid_t tgid, pid_t tid, int sig); */
+   PRINT("sys_tgkill ( %d, %d, %d )", ARG1,ARG2,ARG3);
+   PRE_REG_READ3(long, "tgkill", int, tgid, int, tid, int, sig);
+   if (!VG_(client_signal_OK)(ARG3))
+      SET_RESULT( -VKI_EINVAL );
+}
+
+POST(sys_tgkill)
+{
+   if (VG_(clo_trace_signals))
+      VG_(message)(Vg_DebugMsg, "tgkill: sent signal %d to pid %d/%d",
+                   ARG3, ARG1, ARG2);
+   // Check to see if this kill gave us a pending signal
+   VG_(poll_signals)(tid);
+}
+
+
 // Nb: this wrapper is "Special" because we have to pad/unpad memory around
 // the syscall itself, and this allows us to control exactly the code that
 // gets run while the padding is in place.
index d3da367b09caee58d6a4ff6c4a54d31bedfd5645..56a8c31d6460dfd7014e76654f7236aca327bc37 100644 (file)
@@ -1590,7 +1590,7 @@ const struct SyscallTableEntry VGA_(syscall_table)[] = {
    GENXY(__NR_statfs64,          sys_statfs64),       // 268
    GENXY(__NR_fstatfs64,         sys_fstatfs64),      // 269
 
-   //   (__NR_tgkill,            sys_tgkill),         // 270 */Linux
+   LINXY(__NR_tgkill,            sys_tgkill),         // 270 */Linux
    GENX_(__NR_utimes,            sys_utimes),         // 271
    //   (__NR_fadvise64_64,      sys_fadvise64_64),   // 272 */(Linux?)
    GENX_(__NR_vserver,           sys_ni_syscall),     // 273