aboutsummaryrefslogtreecommitdiff
path: root/test/test-inject.c
blob: 6cf0404e3e25d713a3026a1a492a85df8de42f60 (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 <= 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);
}