Use pthread_getspecific(3C) to get the calling thread's binding for key, and store the binding in the location pointed to by value.
void *pthread_getspecific(pthread_key_t key);
#include <pthread.h> pthread_key_t key; void *value; /* key previously created */ value = pthread_getspecific(key);
pthread_getspecific returns no errors.