From: Nicholas Nethercote Date: Thu, 23 Jul 2009 00:06:16 +0000 (+0000) Subject: Add support for __pthread_kill(). This hopefully fixes bug 201016. X-Git-Tag: svn/VALGRIND_3_5_0~311 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eefed9ebfcd19100ffa2653f20d848b46ae6864d;p=thirdparty%2Fvalgrind.git Add support for __pthread_kill(). This hopefully fixes bug 201016. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10537 --- diff --git a/coregrind/m_syswrap/priv_syswrap-darwin.h b/coregrind/m_syswrap/priv_syswrap-darwin.h index bd0d64c0da..84d87935fa 100644 --- a/coregrind/m_syswrap/priv_syswrap-darwin.h +++ b/coregrind/m_syswrap/priv_syswrap-darwin.h @@ -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 diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 4a9dcd9555..4f1b85692a 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -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), diff --git a/include/vki/vki-darwin.h b/include/vki/vki-darwin.h index e65881d81a..9032fdcf93 100644 --- a/include/vki/vki-darwin.h +++ b/include/vki/vki-darwin.h @@ -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 diff --git a/memcheck/tests/darwin/scalar.c b/memcheck/tests/darwin/scalar.c index 8a5c2389e7..097a234b12 100644 --- a/memcheck/tests/darwin/scalar.c +++ b/memcheck/tests/darwin/scalar.c @@ -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;