Back to index

glibc  2.9
tst-tls9.c
Go to the documentation of this file.
00001 #include <dlfcn.h>
00002 #include <stdio.h>
00003 #include <stdlib.h>
00004 
00005 #include <link.h>
00006 #include <tls.h>
00007 
00008 #define TEST_FUNCTION do_test ()
00009 static int
00010 do_test (void)
00011 {
00012   static const char modname1[] = "tst-tlsmod5.so";
00013   static const char modname2[] = "tst-tlsmod6.so";
00014   int result = 0;
00015 
00016   void *h1 = dlopen (modname1, RTLD_LAZY);
00017   if (h1 == NULL)
00018     {
00019       printf ("cannot open '%s': %s\n", modname1, dlerror ());
00020       result = 1;
00021     }
00022   void *h2 = dlopen (modname2, RTLD_LAZY);
00023   if (h2 == NULL)
00024     {
00025       printf ("cannot open '%s': %s\n", modname2, dlerror ());
00026       result = 1;
00027     }
00028 
00029   if (h1 != NULL)
00030     dlclose (h1);
00031   if (h2 != NULL)
00032     dlclose (h2);
00033 
00034   return result;
00035 }
00036 
00037 
00038 #include "../test-skeleton.c"