Update.
[glibc.git] / elf / loadfail.c
blob60deb7737b670de8fd45e6060cf151f92f3eac20
1 #include <dlfcn.h>
2 #include <error.h>
3 #include <stdio.h>
4 #include <stdlib.h>
6 int
7 main (void)
9 void *h;
11 if (dlopen ("testobj1.so", RTLD_GLOBAL | RTLD_NOW) == NULL
12 || dlopen ("testobj1.so", RTLD_GLOBAL | RTLD_NOW) == NULL
13 || dlopen ("testobj2.so", RTLD_GLOBAL | RTLD_NOW) == NULL
14 || dlopen ("testobj3.so", RTLD_GLOBAL | RTLD_NOW) == NULL
15 || dlopen ("testobj4.so", RTLD_GLOBAL | RTLD_NOW) == NULL
16 || dlopen ("testobj5.so", RTLD_GLOBAL | RTLD_NOW) == NULL)
17 error (EXIT_FAILURE, 0, "failed to load shared object: %s", dlerror ());
19 h = dlopen ("failobj.so", RTLD_GLOBAL | RTLD_NOW);
21 printf ("h = %p, %s\n", h, h == NULL ? "ok" : "fail");
23 return h != NULL;
26 int
27 foo (int a)
29 return 10;