X-Git-Url: https://git.saurik.com/apple/libpthread.git/blobdiff_plain/f1a1da6cf65a9d0e6858678f6c259025cf5d27fd..c6e5f90c4dd303939f631da331df7b356da942e6:/man/pthread_setspecific.3 diff --git a/man/pthread_setspecific.3 b/man/pthread_setspecific.3 index 96104b4..e5350b7 100644 --- a/man/pthread_setspecific.3 +++ b/man/pthread_setspecific.3 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libc_r/man/pthread_setspecific.3,v 1.6.2.4 2001/08/17 15:42:52 ru Exp $ +.\" $FreeBSD$ .\" .Dd April 4, 1996 .Dt PTHREAD_SETSPECIFIC 3 @@ -37,12 +37,9 @@ .Nm pthread_setspecific .Nd set a thread-specific data value .Sh SYNOPSIS -.Fd #include +.In pthread.h .Ft int -.Fo pthread_setspecific -.Fa "pthread_key_t key" -.Fa "const void *value" -.Fc +.Fn pthread_setspecific "pthread_key_t key" "const void *value" .Sh DESCRIPTION The .Fn pthread_setspecific @@ -50,7 +47,7 @@ function associates a thread-specific value with a .Fa key obtained via a previous call to .Fn pthread_key_create . -Different threads may bind different values to the same key. +Different threads can bind different values to the same key. These values are typically pointers to blocks of dynamically allocated memory that have been reserved for use by the calling thread. @@ -58,38 +55,42 @@ reserved for use by the calling thread. The effect of calling .Fn pthread_setspecific with a key value not obtained from -.Fn pthread_key_create , +.Fn pthread_key_create or after .Fa key has been deleted with -.Fn pthread_key_delete , +.Fn pthread_key_delete is undefined. .Pp +The .Fn pthread_setspecific -may be called from a thread-specific data destructor function; -however, this may result in lost storage or infinite loops. +function may be called from a thread-specific data destructor function, +however this may result in lost storage or infinite loops. .Sh RETURN VALUES -If successful, the +If successful, the .Fn pthread_setspecific function will return zero. -Otherwise, an error number will be returned to indicate the error. +Otherwise an error number will be returned to +indicate the error. .Sh ERRORS +The .Fn pthread_setspecific -will fail if: +function will fail if: .Bl -tag -width Er +.It Bq Er ENOMEM +Insufficient memory exists to associate the value with the +.Fa key . .It Bq Er EINVAL The .Fa key value is invalid. -.It Bq Er ENOMEM -Insufficient memory exists to associate the value with the -.Fa key . .El .Sh SEE ALSO .Xr pthread_getspecific 3 , .Xr pthread_key_create 3 , .Xr pthread_key_delete 3 .Sh STANDARDS +The .Fn pthread_setspecific -conforms to +function conforms to .St -p1003.1-96 .