pthread_getspecific(3thr)pthread_getspecific(3thr)Namepthread_getspecific - Obtains the per-thread context associated with
the specified key.
Syntax
#include <pthread.h>
int pthread_getspecific (key, value)
pthread_key_t key;
pthread_addr_t *value;
Arguments
key Context key value that identifies the context value obtained.
This key value must be obtained from pthread_keycreate.
value Address of the current per-thread context value associated with
the specified key.
Description
This routine obtains the per-thread context associated with the speci‐
fied key for the current thread.
Return Values
If an error condition occurs, this routine returns -1 and sets errno to
the corresponding error value. Possible return values are as follows.
Return Error Description
0 Successful comple‐
tion.
-1 [EINVAL] The key value is
invalid.
pthread_getspecific(3thr)