Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (n - p) pthread_setspeci
fic(2)
NAME
pthread_setspecific - Sets the thread-specific data associated with a key
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <spthread.h>
int pthread_setspecific(
pthread_key_t key,
const void *value );
PARAMETERS
key specifies the thread-specific key that identifies the thread-specific data to be set
to the new value. This key value is returned by the pthread_key_create()
func-
tion.
value specifies the new thread-specific data to associate with the key specified by key.
DESCRIPTION
This function sets the thread-specific data associated with the key specified by the key parameter
for the calling thread.
Different threads can bind different data to the same key. This data typically consists of pointers
to blocks of dynamically allocated memory that are reserved for use by the calling thread.
Although the data type of the value parameter (void *) implies that it represents an address, the
type is being used as a "universal scalar type." The system simply stores the value of value for
later retrieval.
RETURN VALUES
If an error condition occurs, this function returns an integer value indicating the type of error.
Possible return values are:
0 Successful completion.
[EINVAL] The specified key is invalid.
[ENOMEM] Insufficient memory exists to associate the new data with the key.
RELATED INFORMATION
Functions: pthread_getspecific(2), pthread_key_create(2), pthread_key_delete(2).
STANDARDS CONFORMANCE
This function is an extension to the XPG4 Version 2 specification. Interfaces documented on this
reference page conform to the following industry standards:
• IEEE Std 1003.1c-1995, POSIX System Application Program Interface
The use of the header file spthread.h is an HP exception to the POSIX standard.
527186-003 Hewlett-Packard Company 5−97