aboutsummaryrefslogtreecommitdiff
path: root/test/test-inject.c
blob: 53918db124d7dfefbce818cb35dc4477327db24b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 <= 2) {
        printf("usage: test-inject <pid> <dylib>n");
        return 1;
    }
    int pid = atoi(argv[1]);
    char *error = NULL;
    int ret = substitute_dlopen_in_pid(pid, argv[2], 0, &error);
    printf("ret=%d err=%s\n", ret, error);
}