manual: Correct argument order in mount examples [BZ #27207]
[glibc.git] / elf / tst-tls18.c
blobb705b61d60f2bb53329dfa4d136044e5b54d81fc
1 #include <dlfcn.h>
2 #include <stdlib.h>
3 #include <stdio.h>
5 static int
6 do_test (void)
8 char modname[sizeof "tst-tlsmod18aXX.so"];
9 void *h[20];
10 for (int i = 0; i < 20; i++)
12 snprintf (modname, sizeof modname, "tst-tlsmod18a%d.so", i);
13 h[i] = dlopen (modname, RTLD_LAZY);
14 if (h[i] == NULL)
16 printf ("unexpectedly failed to open %s", modname);
17 exit (1);
21 for (int i = 0; i < 20; i++)
23 int (*fp) (void) = (int (*) (void)) dlsym (h[i], "test");
24 if (fp == NULL)
26 printf ("cannot find test in tst-tlsmod18a%d.so", i);
27 exit (1);
30 if (fp ())
31 exit (1);
34 return 0;
37 #include <support/test-driver.c>