#include #include #include #include #include static void * start(void *cookie) { char buf[] = "GC-marker-NNN"; snprintf(buf, sizeof buf, "GC-marker-%u", (unsigned)(uintptr_t)cookie); strdup(buf); return NULL; } int main(void) { pthread_t t[24]; unsigned i; int error; for (i = 0; i < __arraycount(t); i++) { error = pthread_create(&t[i], NULL, &start, (void *)(uintptr_t)i); if (error) errc(1, error, "pthread_create"); } for (i = 0; i < __arraycount(t); i++) { error = pthread_join(t[i], NULL); if (error) errc(1, error, "pthread_join"); } return 0; }