Back to index

glibc  2.9
tst-tls15.c
Go to the documentation of this file.
00001 #include <dlfcn.h>
00002 #include <stdio.h>
00003 
00004 static int
00005 do_test (void)
00006 {
00007   void *h = dlopen ("tst-tlsmod15a.so", RTLD_NOW);
00008   if (h != NULL)
00009     {
00010       puts ("unexpectedly succeeded to open tst-tlsmod15a.so");
00011       exit (1);
00012     }
00013 
00014   h = dlopen ("tst-tlsmod15b.so", RTLD_NOW);
00015   if (h == NULL)
00016     {
00017       puts ("failed to open tst-tlsmod15b.so");
00018       exit (1);
00019     }
00020 
00021   int (*fp) (void) = (int (*) (void)) dlsym (h, "in_dso");
00022   if (fp == NULL)
00023     {
00024       puts ("cannot find in_dso");
00025       exit (1);
00026     }
00027 
00028   return fp ();
00029 }
00030 
00031 #define TEST_FUNCTION do_test ()
00032 #include "../test-skeleton.c"