summaryrefslogtreecommitdiff
path: root/ext/dl/eg/main.c
blob: ac0155453ecdda91a29a72f9eb42174040d82402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <dlfcn.h>
#include <stdio.h>

main(argc, argv, arge)
int argc;
char **argv;
char **arge;
{
    void	*obj;
    void	(*proc)();
    void	*obj1;
    void	(*proc1)();

    if (!(obj = dlopen("test", 1)))
	fprintf(stderr, "%s\n", dlerror());
    if (!(obj1 = dlopen("test1", 1)))
	fprintf(stderr, "%s\n", dlerror());
    proc = (void (*)())dlsym(obj, "test");
    proc1 = (void (*)())dlsym(obj1, "test1");
    proc();
    proc1();
    dlclose(obj);
}

void print()
{
    printf("got here!\n");
}