Updated to fedora-glibc-20090409T1422
[glibc/history.git] / elf / resolvfail.c
blobebd635d153a9b27d8901f09246e3def7eb98d1d2
1 #include <dlfcn.h>
2 #include <stdio.h>
4 static const char obj[] = "testobj1.so";
6 int
7 main (void)
9 void *d = dlopen (obj, RTLD_LAZY);
10 int n;
12 if (d == NULL)
14 printf ("cannot load %s: %s\n", obj, dlerror ());
15 return 1;
18 for (n = 0; n < 10000; ++n)
19 if (dlsym (d, "does not exist") != NULL)
21 puts ("dlsym() did not fail");
22 return 1;
24 else if (dlerror () == NULL)
26 puts ("dlerror() didn't return a string");
27 return 1;
30 return 0;