diff options
author | hsu <hsu@FreeBSD.org> | 1996-11-11 09:05:29 +0000 |
---|---|---|
committer | hsu <hsu@FreeBSD.org> | 1996-11-11 09:05:29 +0000 |
commit | d1d957f50c1408ea2fee4485be9a8aeab671794c (patch) | |
tree | ff19f8c4b29a0209a553ba6af1c7e0faeeecae41 /lib/libpthread/thread/thr_spec.c | |
parent | 26976c4aeef49bec6f7209edbdc489614ba70a12 (diff) | |
download | FreeBSD-src-d1d957f50c1408ea2fee4485be9a8aeab671794c.zip FreeBSD-src-d1d957f50c1408ea2fee4485be9a8aeab671794c.tar.gz |
Make pthread_getspecific() compliant with the final IEEE pthreads
specification: return parameter passing changed.
Diffstat (limited to 'lib/libpthread/thread/thr_spec.c')
-rw-r--r-- | lib/libpthread/thread/thr_spec.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libpthread/thread/thr_spec.c b/lib/libpthread/thread/thr_spec.c index cc83c60..4447a75 100644 --- a/lib/libpthread/thread/thr_spec.c +++ b/lib/libpthread/thread/thr_spec.c @@ -184,12 +184,12 @@ pthread_setspecific(pthread_key_t key, const void *value) return (ret); } -int -pthread_getspecific(pthread_key_t key, void **p_data) +void * +pthread_getspecific(pthread_key_t key) { pthread_t pthread; - int rval = 0; int status; + void *data; /* Block signals: */ _thread_kern_sig_block(&status); @@ -207,31 +207,31 @@ pthread_getspecific(pthread_key_t key, void **p_data) } /* Check for errors: */ - if (pthread == NULL || p_data == NULL) { + if (pthread == NULL) { /* Return an invalid argument error: */ _thread_seterrno(_thread_run, EINVAL); - rval = -1; + data = NULL; } /* Check if there is specific data: */ else if (pthread->specific_data != NULL && (key < PTHREAD_KEYS_MAX) && (key_table)) { /* Check if this key has been used before: */ if (key_table[key].count) { /* Return the value: */ - *p_data = (void *) pthread->specific_data[key]; + data = (void *) pthread->specific_data[key]; } else { /* * This key has not been used before, so return NULL * instead: */ - *p_data = NULL; + data = NULL; } } else { /* No specific data has been created, so just return NULL: */ - *p_data = NULL; + data = NULL; } /* Unblock signals: */ _thread_kern_sig_unblock(status); - return (rval); + return (data); } #endif |