6 #include <gnu/lib-names.h>
11 void *h
= dlopen (LIBM_SO
, RTLD_LAZY
);
14 printf ("dlopen failed: %s\n", dlerror ());
17 if (dlsym (h
, "sin") == NULL
)
19 printf ("dlsym failed: %s\n", dlerror ());
24 printf ("dlclose failed: %s\n", dlerror ());
35 for (int i
= 0; i
< N
; ++i
)
37 int e
= pthread_create (&th
[i
], NULL
, tf
, NULL
);
40 printf ("pthread_create failed with %d (%s)\n", e
, strerror (e
));
44 for (int i
= 0; i
< N
; ++i
)
47 int e
= pthread_join (th
[i
], &res
);
48 if (e
!= 0 || res
!= NULL
)
50 puts ("thread failed");