#include #include #include #include int main(void) { pthread_key_t p_key; pthread_key_create (&p_key,NULL); pthread_setspecific (p_key, (void*) 0x10); switch (fork()) { case -1: return 0; case 0: printf ("child: %p %p\n", pthread_self(), pthread_getspecific (p_key)); break; default: printf ("parent: %p %p\n", pthread_self(), pthread_getspecific (p_key)); } return 0; }