From 2795a1a5b34bffc350f9366fcf05a6165067eafa Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 21 Jan 2015 18:24:08 -0500 Subject: stopping other threads. --- lib/substitute.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/substitute.h') diff --git a/lib/substitute.h b/lib/substitute.h index 3adb39a..ada57f2 100644 --- a/lib/substitute.h +++ b/lib/substitute.h @@ -44,6 +44,12 @@ enum { * preventing pages from being marked executable. */ SUBSTITUTE_ERR_VM, + /* substitute_hook_functions: not on the main thread (so stopping all other + * threads would be unsafe, as concurrent attempts to do the same from + * other threads would result in deadlock), and you did not pass + * SUBSTITUTE_DONT_STOP_THREADS */ + SUBSTITUTE_ERR_NOT_ON_MAIN_THREAD, + /* substitute_interpose_imports: couldn't redo relocation for an import * because the type was unknown */ SUBSTITUTE_ERR_UNKNOWN_RELOCATION_TYPE, @@ -51,6 +57,9 @@ enum { /* substitute_hook_objc_message: no such selector existed in the class's * inheritance tree */ SUBSTITUTE_ERR_NO_SUCH_SELECTOR, + + /* substitute_hook_functions: OS error suspending other threads */ + SUBSTITUTE_ERR_ADJUSTING_THREADS, }; struct substitute_function_hook { @@ -62,6 +71,11 @@ struct substitute_function_hook { /* Get a string representation for a SUBSTITUTE_* error code. */ const char *substitute_strerror(int err); +/* substitute_hook_functions options */ +enum { + SUBSTITUTE_DONT_STOP_THREADS = 1, +}; + /* TODO doc */ int substitute_hook_functions(const struct substitute_function_hook *hooks, size_t nhooks, -- cgit v1.2.3