Updated to fedora-glibc-20041014T0548
[glibc.git] / elf / tst-dlmopen1mod.c
blob40a4c8fa4419b7d0bf4232be7881ffe8945242e3
1 #include <dlfcn.h>
2 #include <stdio.h>
3 #include <gnu/lib-names.h>
6 int
7 foo (Lmid_t ns2)
9 void *h = dlopen (LIBC_SO, RTLD_LAZY|RTLD_NOLOAD);
10 if (h == NULL)
12 printf ("cannot get handle for %s: %s\n", LIBC_SO, dlerror ());
13 return 1;
16 Lmid_t ns = -10;
17 if (dlinfo (h, RTLD_DI_LMID, &ns) != 0)
19 printf ("dlinfo for %s in %s failed: %s\n",
20 LIBC_SO, __func__, dlerror ());
21 return 1;
24 if (ns != ns2)
26 printf ("namespace for %s not LM_ID_BASE\n", LIBC_SO);
27 return 1;
30 if (dlclose (h) != 0)
32 printf ("dlclose for %s in %s failed: %s\n",
33 LIBC_SO, __func__, dlerror ());
34 return 1;
37 return 0;