aboutsummaryrefslogtreecommitdiff
path: root/test/test-inject.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-inject.c')
-rw-r--r--test/test-inject.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test-inject.c b/test/test-inject.c
new file mode 100644
index 0000000..6cf0404
--- /dev/null
+++ b/test/test-inject.c
@@ -0,0 +1,17 @@
+#include "substitute.h"
+#include "substitute-internal.h"
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv) {
+ if (argc <= 1) {
+ printf("usage: test-inject <pid>\n");
+ return 1;
+ }
+ int pid = atoi(argv[1]);
+ char *error = NULL;
+ int ret = substitute_dlopen_in_pid(pid, "/tmp/hello", 0, &error);
+ printf("ret=%d err=%s\n", ret, error);
+}