]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add support for __pthread_kill(). This hopefully fixes bug 201016.
authorNicholas Nethercote <njn@valgrind.org>
Thu, 23 Jul 2009 00:06:16 +0000 (00:06 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Thu, 23 Jul 2009 00:06:16 +0000 (00:06 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10537

coregrind/m_syswrap/priv_syswrap-darwin.h
coregrind/m_syswrap/syswrap-darwin.c
include/vki/vki-darwin.h
memcheck/tests/darwin/scalar.c

index bd0d64c0da47f86b2eb00fb2e77de10b7d909a41..84d87935fa3e4c4c6d1c392c22af2a949def0933 100644 (file)
@@ -383,7 +383,7 @@ DECL_TEMPLATE(darwin, aio_write);              // 319
 // NYI munlockall 325
 // 326
 DECL_TEMPLATE(darwin, issetugid);               // 327
-// NYI __pthread_kill 328
+DECL_TEMPLATE(darwin, __pthread_kill);          // 328
 DECL_TEMPLATE(darwin, __pthread_sigmask);       // 329
 // NYI __sigwait 330
 DECL_TEMPLATE(darwin, __disable_threadsignal);  // 331
index 4a9dcd95559f21cda44ea7d93d212be370d35074..4f1b85692a2d12e65152d7dc5ce126e0d24cd008 100644 (file)
@@ -1563,6 +1563,13 @@ POST(sigaction)
 }
 
 
+PRE(__pthread_kill)
+{
+   PRINT("__pthread_kill ( %ld, %ld )", ARG1, ARG2);
+   PRE_REG_READ2(long, "__pthread_kill", vki_pthread_t*, thread, int, sig);
+}
+
+
 PRE(__pthread_sigmask)
 {
    // GrP fixme
@@ -7437,7 +7444,7 @@ const SyscallTableEntry ML_(syscall_table)[] = {
 // _____(__NR_munlockall), 
    _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(326)),   // ???
    MACX_(__NR_issetugid,               issetugid), 
-// _____(__NR___pthread_kill), 
+   MACX_(__NR___pthread_kill,          __pthread_kill),
    MACX_(__NR___pthread_sigmask,       __pthread_sigmask), 
 // _____(__NR___sigwait), 
    MACX_(__NR___disable_threadsignal,  __disable_threadsignal), 
index e65881d81ab13efa320d67b1e793bdf92206d06f..9032fdcf934678b1737d921b9b79ffd522e858a0 100644 (file)
@@ -71,6 +71,7 @@
 #define vki_clock_t clock_t
 #define vki_u_int32_t u_int32_t
 #define vki_u_int16_t u_int16_t
+#define vki_pthread_t pthread_t
 
 
 // valgrind special
index 8a5c2389e77d3ccf1b3db386bf77990bc9e82696..097a234b1230c5df26a189247778b91b728ce86c 100644 (file)
@@ -576,7 +576,10 @@ int main(void)
    GO_UNIMP(326, "unused");
 
    // __NR_issetugid 327
-   // __NR___pthread_kill 328
+
+   GO(__NR___pthread_kill, 328, "2s 0m");
+   SY(__NR___pthread_kill, x0, x0); FAIL;
+
    // __NR___pthread_sigmask 329
    // __NR___sigwait 330
    // __NR_sigwait 330) // GrP fixme hack
@@ -730,7 +733,7 @@ int main(void)
  //SY(__NR_stime); // (Not yet handled by Valgrind) FAIL;
 
    // __NR_ptrace 26
-   // XXX: memory pointed to be arg3 goes unchecked... otherwise would be 2m
+   // XXX: memory pointed to by arg3 goes unchecked... otherwise would be 2m
    GO(__NR_ptrace, "4s 1m");
    SY(__NR_ptrace, x0+PTRACE_GETREGS, x0, x0, x0); FAIL;