tst-tls9.c 663 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include <dlfcn.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <link.h>
  5. static int
  6. do_test (void)
  7. {
  8. static const char modname1[] = "tst-tlsmod5.so";
  9. static const char modname2[] = "tst-tlsmod6.so";
  10. int result = 0;
  11. void *h1 = dlopen (modname1, RTLD_LAZY);
  12. if (h1 == NULL)
  13. {
  14. printf ("cannot open '%s': %s\n", modname1, dlerror ());
  15. result = 1;
  16. }
  17. void *h2 = dlopen (modname2, RTLD_LAZY);
  18. if (h2 == NULL)
  19. {
  20. printf ("cannot open '%s': %s\n", modname2, dlerror ());
  21. result = 1;
  22. }
  23. if (h1 != NULL)
  24. dlclose (h1);
  25. if (h2 != NULL)
  26. dlclose (h2);
  27. return result;
  28. }
  29. #include <support/test-driver.c>