pthread_getspecific man page on BSDi

Man page or keyword search:  
man Server   6284 pages
apropos Keyword Search (all sections)
Output format
BSDi logo
[printable version]

PTHREAD_SPECIFIC(3)	    BSD Programmer's Manual	   PTHREAD_SPECIFIC(3)

NAME
     pthread_setspecific, pthread_getspecific - thread specific data value
     functions

SYNOPSIS
     #include <pthread.h>

     int
     pthread_setspecific(pthread_key_t key, void *value);

     void *
     pthread_getspecific(pthread_key_t key);

DESCRIPTION
     This interface is defined by IEEE Std1003.1c (``POSIX'').

     The pthread_setspecific() and pthread_getspecific() functions maintain
     thread-specific data values associated with data keys created by calling
     pthread_key_create().

     The pthread_setspecific() function associates the data value specified in
     value with the data key key previously created by a call to
     pthread_key_create().  While data keys are unique within the implementa-
     tion the data values associated with them are maintained per-thread.  The
     intent is to allow creation of per-thread state for functions that re-
     quire that local state be maintained.

     The pthread_getspecific() function retrieves a data value previously reg-
     istered with pthread_setspecific().

     Calling pthread_setspecific() or pthread_getspecific() with a key value
     not previously created with a call to pthread_key_create() results in un-
     defined behavior.

RETURN VALUES
     Upon successful completion, pthread_getspecific() returns the thread spe-
     cific data value associated with key or a NULL to indicate that no
     thread-specific data value is available.

     Upon successful completion, the pthread_setspecific() function returns 0.
     A non-zero result indicates that an error occurred.

ERRORS
     The pthread_setspecific function may fail and return one of the following
     errors:

     [EINVAL]	   The key value is invalid.

     [ENOMEM]	   Insufficient memory exists to associate the specified value
		   with key.

SEE ALSO
     pthreads(3),  pthread_exit(3),  pthread_key_create(3),
     pthread_key_delete(3)

STANDARDS
     The pthread_setspecific and pthread_getspecific functions conform to IEEE
     Std1003.1c (``POSIX'').

HISTORY
     The pthread_setspecific and pthread_getspecific functions first appeared
     in BSD/OS 3.0.

4th Berkeley Distribution	 June 3, 1996				     1
[top]

List of man pages available for BSDi

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net