aboutsummaryrefslogtreecommitdiff
path: root/lib/substitute.h
diff options
context:
space:
mode:
authorcomex2015-01-21 18:24:08 -0500
committercomex2015-01-21 18:24:08 -0500
commit2795a1a5b34bffc350f9366fcf05a6165067eafa (patch)
tree23d2a31654b4306637fc56796d82962abec3a337 /lib/substitute.h
parentadd substitute_strerror (diff)
downloadsubstitute-2795a1a5b34bffc350f9366fcf05a6165067eafa.tar.gz
stopping other threads.
Diffstat (limited to 'lib/substitute.h')
-rw-r--r--lib/substitute.h14
1 files changed, 14 insertions, 0 deletions
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,