tst-tls9.c 732 B

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