]> sourceware.org Git - glibc.git/blob - elf/tst-dlmopen1mod.c
[BZ #77]
[glibc.git] / elf / tst-dlmopen1mod.c
1 #include <dlfcn.h>
2 #include <stdio.h>
3 #include <gnu/lib-names.h>
4
5
6 int
7 foo (Lmid_t ns2)
8 {
9 void *h = dlopen (LIBC_SO, RTLD_LAZY|RTLD_NOLOAD);
10 if (h == NULL)
11 {
12 printf ("cannot get handle for %s: %s\n", LIBC_SO, dlerror ());
13 return 1;
14 }
15
16 Lmid_t ns = -10;
17 if (dlinfo (h, RTLD_DI_LMID, &ns) != 0)
18 {
19 printf ("dlinfo for %s in %s failed: %s\n",
20 LIBC_SO, __func__, dlerror ());
21 return 1;
22 }
23
24 if (ns != ns2)
25 {
26 printf ("namespace for %s not LM_ID_BASE\n", LIBC_SO);
27 return 1;
28 }
29
30 if (dlclose (h) != 0)
31 {
32 printf ("dlclose for %s in %s failed: %s\n",
33 LIBC_SO, __func__, dlerror ());
34 return 1;
35 }
36
37 return 0;
38 }
This page took 0.036123 seconds and 5 git commands to generate.