Fix copy&paste error.
[glibc/history.git] / elf / unload6.c
blob1efc7eb841dc40f9fec69f933470258f39f5ea9c
1 #include <dlfcn.h>
2 #include <stdio.h>
4 int
5 main (void)
7 void *h = dlopen ("unload6mod1.so", RTLD_LAZY);
8 if (h == NULL)
10 puts ("dlopen unload6mod1.so failed");
11 return 1;
14 int (*fn) (int);
15 fn = dlsym (h, "foo");
16 if (fn == NULL)
18 puts ("dlsym failed");
19 return 1;
22 int val = fn (16);
23 if (val != 24)
25 printf ("foo returned %d != 24\n", val);
26 return 1;
29 return 0;