Back to index

glibc  2.9
tst-tls13.c
Go to the documentation of this file.
00001 /* Check unloading modules with data in static TLS block.  */
00002 #include <dlfcn.h>
00003 #include <stdio.h>
00004 #include <stdlib.h>
00005 #include <unistd.h>
00006 
00007 
00008 static int
00009 do_test (void)
00010 {
00011   for (int i = 0; i < 1000;)
00012     {
00013       printf ("round %d\n",++i);
00014 
00015       void *h = dlopen ("$ORIGIN/tst-tlsmod13a.so", RTLD_LAZY);
00016       if (h == NULL)
00017        {
00018          printf ("cannot load: %s\n", dlerror ());
00019          exit (1);
00020        }
00021 
00022       dlclose (h);
00023     }
00024 
00025   return 0;
00026 }
00027 
00028 #define TEST_FUNCTION do_test ()
00029 #define TIMEOUT 3
00030 #include "../test-skeleton.c"