tst-tls9.c 750 B

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