Open System Services System Calls Reference Manual (G06.25+, H06.03+)

System Functions (n - p) pthread_setspeci
c(2)
NAME
pthread_setspecic - Sets the thread-specic 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_setspecic(
pthread_key_t key,
const void *value );
PARAMETERS
key species the thread-specic key that identies the thread-specic data to be set
to the new value. This key value is returned by the pthread_key_create()
func-
tion.
value species the new thread-specic data to associate with the key specied by key.
DESCRIPTION
This function sets the thread-specic data associated with the key specied 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 specied key is invalid.
[ENOMEM] Insufcient memory exists to associate the new data with the key.
RELATED INFORMATION
Functions: pthread_getspecic(2), pthread_key_create(2), pthread_key_delete(2).
STANDARDS CONFORMANCE
This function is an extension to the XPG4 Version 2 specication. 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 le spthread.h is an HP exception to the POSIX standard.
527186-003 Hewlett-Packard Company 597