Skip to content

Commit

Permalink
Add thread_get_special_reply_port support for macOS High Sierra and l…
Browse files Browse the repository at this point in the history
…ater
  • Loading branch information
LouisBrunner committed Mar 5, 2020
1 parent afe6242 commit fbdf59b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion coregrind/m_syswrap/priv_syswrap-darwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ DECL_TEMPLATE(darwin, task_for_pid);
DECL_TEMPLATE(darwin, pid_for_task);

#if DARWIN_VERS >= DARWIN_10_13
// NYI thread_get_special_reply_port // 50
DECL_TEMPLATE(darwin, thread_get_special_reply_port);
#endif /* DARWIN_VERS >= DARWIN_10_13 */

#if DARWIN_VERS >= DARWIN_10_12
Expand Down
22 changes: 21 additions & 1 deletion coregrind/m_syswrap/syswrap-darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -10124,6 +10124,26 @@ POST(mach_generate_activity_id)
#endif /* DARWIN_VERS >= DARWIN_10_12 */


/* ---------------------------------------------------------------------
Added for macOS 10.13 (High Sierra)
------------------------------------------------------------------ */

#if DARWIN_VERS >= DARWIN_10_13

PRE(thread_get_special_reply_port)
{
PRINT("thread_get_special_reply_port()");
}

POST(thread_get_special_reply_port)
{
record_named_port(tid, RES, MACH_PORT_RIGHT_RECEIVE, "special-reply-%p");
PRINT("special reply port %s", name_for_port(RES));
}

#endif /* DARWIN_VERS >= DARWIN_10_13 */


/* ---------------------------------------------------------------------
syscall tables
------------------------------------------------------------------ */
Expand Down Expand Up @@ -10865,7 +10885,7 @@ const SyscallTableEntry ML_(mach_trap_table)[] = {
_____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(49)),
#endif
#if DARWIN_VERS >= DARWIN_10_13
// _____(__NR_thread_get_special_reply_port, // 50
MACXY(__NR_thread_get_special_reply_port, thread_get_special_reply_port),
#else
_____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(50)),
#endif /* DARWIN_VERS >= DARWIN_10_13 */
Expand Down

0 comments on commit fbdf59b

Please sign in to comment.