thr_getspecific(3C) stores the current value bound to key for the calling thread into the location pointed to by valuep. For POSIX threads, see pthread_getspecific Syntax.
#include <thread.h> int thr_getspecific(thread_key_t key, void **valuep);
thr_getspecific() returns 0 if successful. When any of the following conditions is detected, thr_getspecific() fails and returns the corresponding value.
ENOMEM
Description:Insufficient memory is available to associate value with keyp.
EINVAL
Description:keyp is invalid.