From 386812d440d0d5a37b4dbed04202c2524693a8a3 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Sat, 18 Dec 1999 01:00:42 +0000 Subject: [PATCH] Fix some minor POSIX/SUSv2 compliance nits. PR: kern/11982 --- include/pthread.h | 6 ++---- lib/libc_r/Makefile | 1 + lib/libc_r/uthread/uthread_rwlockattr.c | 11 ++++------- lib/libkse/Makefile | 1 + lib/libkse/thread/thr_rwlockattr.c | 11 ++++------- lib/libpthread/Makefile | 1 + lib/libpthread/thread/thr_rwlockattr.c | 11 ++++------- 7 files changed, 17 insertions(+), 25 deletions(-) diff --git a/include/pthread.h b/include/pthread.h index f67720dada29..8f620258a603 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -228,7 +228,7 @@ int pthread_join __P((pthread_t, void **)); int pthread_key_create __P((pthread_key_t *, void (*) (void *))); int pthread_key_delete __P((pthread_key_t)); -int pthread_kill __P((struct pthread *, int)); +int pthread_kill __P((pthread_t, int)); int pthread_mutexattr_init __P((pthread_mutexattr_t *)); int pthread_mutexattr_destroy __P((pthread_mutexattr_t *)); int pthread_mutexattr_settype __P((pthread_mutexattr_t *, int)); @@ -252,7 +252,7 @@ int pthread_rwlockattr_init __P((pthread_rwlockattr_t *)); int pthread_rwlockattr_getpshared __P((const pthread_rwlockattr_t *, int *)); int pthread_rwlockattr_setpshared __P((pthread_rwlockattr_t *, - int *)); + int)); int pthread_rwlockattr_destroy __P((pthread_rwlockattr_t *)); pthread_t pthread_self __P((void)); int pthread_setspecific __P((pthread_key_t, const void *)); @@ -309,8 +309,6 @@ int pthread_setschedparam __P((pthread_t, int, int pthread_attr_setfloatstate __P((pthread_attr_t *, int)); int pthread_attr_getfloatstate __P((pthread_attr_t *, int *)); -int pthread_attr_setcleanup __P((pthread_attr_t *, - void (*) (void *), void *)); __END_DECLS #endif diff --git a/lib/libc_r/Makefile b/lib/libc_r/Makefile index 87110f07636c..e79d5c58d17f 100644 --- a/lib/libc_r/Makefile +++ b/lib/libc_r/Makefile @@ -10,6 +10,7 @@ SHLIB_MAJOR= 4 SHLIB_MINOR= 0 CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/../libc/include CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE -I${.CURDIR}/uthread +CFLAGS+=-I${.CURDIR}/../../include # Uncomment this if you want libc_r to contain debug information for # thread locking. diff --git a/lib/libc_r/uthread/uthread_rwlockattr.c b/lib/libc_r/uthread/uthread_rwlockattr.c index 3330ba19ff3e..7a56bca7d4ba 100644 --- a/lib/libc_r/uthread/uthread_rwlockattr.c +++ b/lib/libc_r/uthread/uthread_rwlockattr.c @@ -81,16 +81,13 @@ pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr) } int -pthread_rwlockattr_setpshared (pthread_rwlockattr_t *rwlockattr, - int *pshared) +pthread_rwlockattr_setpshared (pthread_rwlockattr_t *rwlockattr, int pshared) { - int ps = *pshared; - - /* only PTHREAD_PROCESS_PRIVATE is supported */ - if (ps != PTHREAD_PROCESS_PRIVATE) + /* Only PTHREAD_PROCESS_PRIVATE is supported. */ + if (pshared != PTHREAD_PROCESS_PRIVATE) return(EINVAL); - (*rwlockattr)->pshared = ps; + (*rwlockattr)->pshared = pshared; return(0); } diff --git a/lib/libkse/Makefile b/lib/libkse/Makefile index 87110f07636c..e79d5c58d17f 100644 --- a/lib/libkse/Makefile +++ b/lib/libkse/Makefile @@ -10,6 +10,7 @@ SHLIB_MAJOR= 4 SHLIB_MINOR= 0 CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/../libc/include CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE -I${.CURDIR}/uthread +CFLAGS+=-I${.CURDIR}/../../include # Uncomment this if you want libc_r to contain debug information for # thread locking. diff --git a/lib/libkse/thread/thr_rwlockattr.c b/lib/libkse/thread/thr_rwlockattr.c index 3330ba19ff3e..7a56bca7d4ba 100644 --- a/lib/libkse/thread/thr_rwlockattr.c +++ b/lib/libkse/thread/thr_rwlockattr.c @@ -81,16 +81,13 @@ pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr) } int -pthread_rwlockattr_setpshared (pthread_rwlockattr_t *rwlockattr, - int *pshared) +pthread_rwlockattr_setpshared (pthread_rwlockattr_t *rwlockattr, int pshared) { - int ps = *pshared; - - /* only PTHREAD_PROCESS_PRIVATE is supported */ - if (ps != PTHREAD_PROCESS_PRIVATE) + /* Only PTHREAD_PROCESS_PRIVATE is supported. */ + if (pshared != PTHREAD_PROCESS_PRIVATE) return(EINVAL); - (*rwlockattr)->pshared = ps; + (*rwlockattr)->pshared = pshared; return(0); } diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile index 87110f07636c..e79d5c58d17f 100644 --- a/lib/libpthread/Makefile +++ b/lib/libpthread/Makefile @@ -10,6 +10,7 @@ SHLIB_MAJOR= 4 SHLIB_MINOR= 0 CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/../libc/include CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE -I${.CURDIR}/uthread +CFLAGS+=-I${.CURDIR}/../../include # Uncomment this if you want libc_r to contain debug information for # thread locking. diff --git a/lib/libpthread/thread/thr_rwlockattr.c b/lib/libpthread/thread/thr_rwlockattr.c index 3330ba19ff3e..7a56bca7d4ba 100644 --- a/lib/libpthread/thread/thr_rwlockattr.c +++ b/lib/libpthread/thread/thr_rwlockattr.c @@ -81,16 +81,13 @@ pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr) } int -pthread_rwlockattr_setpshared (pthread_rwlockattr_t *rwlockattr, - int *pshared) +pthread_rwlockattr_setpshared (pthread_rwlockattr_t *rwlockattr, int pshared) { - int ps = *pshared; - - /* only PTHREAD_PROCESS_PRIVATE is supported */ - if (ps != PTHREAD_PROCESS_PRIVATE) + /* Only PTHREAD_PROCESS_PRIVATE is supported. */ + if (pshared != PTHREAD_PROCESS_PRIVATE) return(EINVAL); - (*rwlockattr)->pshared = ps; + (*rwlockattr)->pshared = pshared; return(0); }