From ba44cef0bfa106de3a4406fdaed071461f87a6f3 Mon Sep 17 00:00:00 2001 From: comex Date: Tue, 20 Jan 2015 19:49:44 -0500 Subject: progress on injection --- lib/substitute-internal.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/substitute-internal.h') diff --git a/lib/substitute-internal.h b/lib/substitute-internal.h index 0f3e0ad..b21a190 100644 --- a/lib/substitute-internal.h +++ b/lib/substitute-internal.h @@ -53,3 +53,22 @@ typedef struct section section_x; #elif defined(TARGET_arm64) #include "arm64/misc.h" #endif + +#ifdef __APPLE__ +/* This could graduate to a public API but is not yet. */ +enum { + SUBSTITUTE_DIP_INJECT_MAIN_THREAD, /* not yet */ +}; + +enum { + /* substitute_dlopen_in_pid: task_for_pid failed; on OS X the reasons this + * can happen are really complicated and dumb, but generally one solution + * is to be root */ + SUBSTITUTE_ERR_TASK_FOR_PID = 1000, + + /* substitute_dlopen_in_pid: something didn't work */ + SUBSTITUTE_ERR_MISC, +}; + +int substitute_dlopen_in_pid(int pid, const char *filename, int options, char **error); +#endif -- cgit v1.2.3