diff options
author | Jakub Jelinek <jakub@redhat.com> | 2004-10-14 05:57:55 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2004-10-14 05:57:55 +0000 |
commit | 9869e6ec913e268748f510ab6ec64b8fd62531bc (patch) | |
tree | f3f8b9c049c73755d183cc1c1affd34ee8f9772b /elf/tst-dlmopen1mod.c | |
parent | 3ee87ca7d4c813087eeee8b9fd04b7836244a54a (diff) |
Updated to fedora-glibc-20041014T0548
Diffstat (limited to 'elf/tst-dlmopen1mod.c')
-rw-r--r-- | elf/tst-dlmopen1mod.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/elf/tst-dlmopen1mod.c b/elf/tst-dlmopen1mod.c new file mode 100644 index 0000000000..40a4c8fa44 --- /dev/null +++ b/elf/tst-dlmopen1mod.c @@ -0,0 +1,38 @@ +#include <dlfcn.h> +#include <stdio.h> +#include <gnu/lib-names.h> + + +int +foo (Lmid_t ns2) +{ + void *h = dlopen (LIBC_SO, RTLD_LAZY|RTLD_NOLOAD); + if (h == NULL) + { + printf ("cannot get handle for %s: %s\n", LIBC_SO, dlerror ()); + return 1; + } + + Lmid_t ns = -10; + if (dlinfo (h, RTLD_DI_LMID, &ns) != 0) + { + printf ("dlinfo for %s in %s failed: %s\n", + LIBC_SO, __func__, dlerror ()); + return 1; + } + + if (ns != ns2) + { + printf ("namespace for %s not LM_ID_BASE\n", LIBC_SO); + return 1; + } + + if (dlclose (h) != 0) + { + printf ("dlclose for %s in %s failed: %s\n", + LIBC_SO, __func__, dlerror ()); + return 1; + } + + return 0; +} |