diff options
author | David Leonard <d@cvs.openbsd.org> | 1998-11-09 03:13:22 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 1998-11-09 03:13:22 +0000 |
commit | ff47464de5e68e9c49fe312c953f54b2e90f546c (patch) | |
tree | 4ec0e7f13d619e1b5bf6abfd7125a4ec17569568 /lib/libpthread/man | |
parent | 1b2b2c2386c6cc5ebffc769b8a39b80d47e4e0d0 (diff) |
sync with FreeBSD (rwlock, gc thread, man pages)
add (broken) mips md stuff
fix some const warnings
add sigaltstack() stub
another hash at getting shlib auto-init to work (mips/elf and i386/a.out)
Diffstat (limited to 'lib/libpthread/man')
36 files changed, 910 insertions, 62 deletions
diff --git a/lib/libpthread/man/Makefile.inc b/lib/libpthread/man/Makefile.inc index 2cae3f76800..8fbdb1c9ccc 100644 --- a/lib/libpthread/man/Makefile.inc +++ b/lib/libpthread/man/Makefile.inc @@ -1,5 +1,5 @@ -# $Id: Makefile.inc,v 1.1 1998/08/27 09:00:33 d Exp $ -# $OpenBSD: Makefile.inc,v 1.1 1998/08/27 09:00:33 d Exp $ +# $Id: Makefile.inc,v 1.2 1998/11/09 03:13:14 d Exp $ +# $OpenBSD: Makefile.inc,v 1.2 1998/11/09 03:13:14 d Exp $ # POSIX thread man files @@ -27,6 +27,15 @@ MAN+= pthread_cleanup_pop.3 \ pthread_mutex_trylock.3 \ pthread_mutex_unlock.3 \ pthread_once.3 \ + pthread_rwlock_destroy.3 \ + pthread_rwlock_init.3 \ + pthread_rwlock_rdlock.3 \ + pthread_rwlock_unlock.3 \ + pthread_rwlock_wrlock.3 \ + pthread_rwlockattr_destroy.3 \ + pthread_rwlockattr_getpshared.3 \ + pthread_rwlockattr_init.3 \ + pthread_rwlockattr_setpshared.3 \ pthread_self.3 \ pthread_setspecific.3 diff --git a/lib/libpthread/man/pread.3 b/lib/libpthread/man/pread.3 new file mode 100644 index 00000000000..c21f88ae4c2 --- /dev/null +++ b/lib/libpthread/man/pread.3 @@ -0,0 +1,36 @@ +.\" $OpenBSD: pread.3,v 1.1 1998/11/09 03:13:14 d Exp $ +.Dd September 7, 1998 +.Os Ox +.Dt PREAD 3 +.Sh NAME +.Nm pread +.Nd atomic seek and read +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft ssize_t +.Fn pread "int filedes" "void *buf" "size_t nbytes" "off_t offset" +.Sh DESCRIPTION +The +.Fn pread +function reads +.Fa nbyte +bytes from offset +.Fa offset +in the file opened on file descriptor +.Fa filedes. +.Pp +This function is provided for use in a threaded, parallel I/O +environment, where race conditions may exist between two threads +non-atomically seeking and reading from the same file descriptor. +.Sh RETURN VALUES +The +.Fn pread +function returns values identical to +.Xr read 3 . +.Sh SEE ALSO +.Xr pthreads 3 , +.Xr read 3 , +.Xr pwrite 3 +.Sh STANDARDS +.Fn pread +conforms to TOG SUSv2 . diff --git a/lib/libpthread/man/pthread_cleanup_pop.3 b/lib/libpthread/man/pthread_cleanup_pop.3 index a244f9441e1..eefe4f335ae 100644 --- a/lib/libpthread/man/pthread_cleanup_pop.3 +++ b/lib/libpthread/man/pthread_cleanup_pop.3 @@ -51,7 +51,6 @@ does not return any value. .Sh ERRORS None .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_cleanup_push 3 , .Xr pthread_exit 3 .Sh STANDARDS diff --git a/lib/libpthread/man/pthread_cleanup_push.3 b/lib/libpthread/man/pthread_cleanup_push.3 index 4a4b876ee4f..9bb3f400b64 100644 --- a/lib/libpthread/man/pthread_cleanup_push.3 +++ b/lib/libpthread/man/pthread_cleanup_push.3 @@ -54,7 +54,6 @@ does not return any value. .Sh ERRORS None .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_cleanup_pop 3 , .Xr pthread_exit 3 .Sh STANDARDS diff --git a/lib/libpthread/man/pthread_cond_broadcast.3 b/lib/libpthread/man/pthread_cond_broadcast.3 index 25f00950db0..3b39287046d 100644 --- a/lib/libpthread/man/pthread_cond_broadcast.3 +++ b/lib/libpthread/man/pthread_cond_broadcast.3 @@ -56,12 +56,11 @@ is invalid. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , -.Xr pthread_cond_init 3 , .Xr pthread_cond_destroy 3 , -.Xr pthread_cond_wait 3 , +.Xr pthread_cond_init 3 , +.Xr pthread_cond_signal 3 , .Xr pthread_cond_timedwait 3 , -.Xr pthread_cond_signal 3 +.Xr pthread_cond_wait 3 .Sh STANDARDS .Fn pthread_cond_broadcast conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_cond_destroy.3 b/lib/libpthread/man/pthread_cond_destroy.3 index 94f2b4210f5..22921b49a5e 100644 --- a/lib/libpthread/man/pthread_cond_destroy.3 +++ b/lib/libpthread/man/pthread_cond_destroy.3 @@ -60,12 +60,11 @@ is locked by another thread. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , +.Xr pthread_cond_broadcast 3 , .Xr pthread_cond_init 3 , -.Xr pthread_cond_wait 3 , -.Xr pthread_cond_timedwait 3 , .Xr pthread_cond_signal 3 , -.Xr pthread_cond_broadcast 3 +.Xr pthread_cond_timedwait 3 , +.Xr pthread_cond_wait 3 .Sh STANDARDS .Fn pthread_cond_destroy conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_cond_init.3 b/lib/libpthread/man/pthread_cond_init.3 index f8c16f49b21..00f669d51be 100644 --- a/lib/libpthread/man/pthread_cond_init.3 +++ b/lib/libpthread/man/pthread_cond_init.3 @@ -65,12 +65,11 @@ The temporarily lacks the resources to create another condition variable. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , +.Xr pthread_cond_broadcast 3 , .Xr pthread_cond_destroy 3 , -.Xr pthread_cond_wait 3 , -.Xr pthread_cond_timedwait 3 , .Xr pthread_cond_signal 3 , -.Xr pthread_cond_broadcast 3 +.Xr pthread_cond_timedwait 3 , +.Xr pthread_cond_wait 3 .Sh STANDARDS .Fn pthread_cond_init conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_cond_signal.3 b/lib/libpthread/man/pthread_cond_signal.3 index ebfd6561f4c..679e46fb2ed 100644 --- a/lib/libpthread/man/pthread_cond_signal.3 +++ b/lib/libpthread/man/pthread_cond_signal.3 @@ -56,12 +56,11 @@ is invalid. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , -.Xr pthread_cond_init 3 , +.Xr pthread_cond_broadcast 3 , .Xr pthread_cond_destroy 3 , -.Xr pthread_cond_wait 3 , +.Xr pthread_cond_init 3 , .Xr pthread_cond_timedwait 3 , -.Xr pthread_cond_broadcast 3 +.Xr pthread_cond_wait 3 .Sh STANDARDS .Fn pthread_cond_signal conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_cond_timedwait.3 b/lib/libpthread/man/pthread_cond_timedwait.3 index 111a3fb117a..ab0184a7c58 100644 --- a/lib/libpthread/man/pthread_cond_timedwait.3 +++ b/lib/libpthread/man/pthread_cond_timedwait.3 @@ -73,12 +73,11 @@ The system time has reached or exceeded the time specified in .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , -.Xr pthread_cond_init 3 , +.Xr pthread_cond_broadcast 3 , .Xr pthread_cond_destroy 3 , -.Xr pthread_cond_wait 3 , +.Xr pthread_cond_init 3 , .Xr pthread_cond_signal 3 , -.Xr pthread_cond_broadcast 3 +.Xr pthread_cond_wait 3 .Sh STANDARDS .Fn pthread_cond_timedwait conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_cond_wait.3 b/lib/libpthread/man/pthread_cond_wait.3 index 69d9257cadf..7f70b591f03 100644 --- a/lib/libpthread/man/pthread_cond_wait.3 +++ b/lib/libpthread/man/pthread_cond_wait.3 @@ -67,12 +67,11 @@ is invalid. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , -.Xr pthread_cond_init 3 , +.Xr pthread_cond_broadcast 3 , .Xr pthread_cond_destroy 3 , -.Xr pthread_cond_timedwait 3 , +.Xr pthread_cond_init 3 , .Xr pthread_cond_signal 3 , -.Xr pthread_cond_broadcast 3 +.Xr pthread_cond_timedwait 3 .Sh STANDARDS .Fn pthread_cond_wait conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_create.3 b/lib/libpthread/man/pthread_create.3 index 7f94ffa0183..6966b56398a 100644 --- a/lib/libpthread/man/pthread_create.3 +++ b/lib/libpthread/man/pthread_create.3 @@ -100,11 +100,10 @@ is invalid. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr fork 2 , -.Xr pthread_exit 3 , -.Xr pthread_cleanup_push 3 , .Xr pthread_cleanup_pop 3 , +.Xr pthread_cleanup_push 3 , +.Xr pthread_exit 3 , .Xr pthread_join 3 .Sh STANDARDS .Fn pthread_create diff --git a/lib/libpthread/man/pthread_detach.3 b/lib/libpthread/man/pthread_detach.3 index a917d632e24..a7f0490ae0d 100644 --- a/lib/libpthread/man/pthread_detach.3 +++ b/lib/libpthread/man/pthread_detach.3 @@ -73,7 +73,6 @@ thread ID, .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_join 3 .Sh STANDARDS .Fn pthread_detach diff --git a/lib/libpthread/man/pthread_equal.3 b/lib/libpthread/man/pthread_equal.3 index 976d2881602..74a588279b9 100644 --- a/lib/libpthread/man/pthread_equal.3 +++ b/lib/libpthread/man/pthread_equal.3 @@ -57,7 +57,6 @@ correspond to the same thread, otherwise it will return zero. None. .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_create 3 , .Xr pthread_exit 3 .Sh STANDARDS diff --git a/lib/libpthread/man/pthread_exit.3 b/lib/libpthread/man/pthread_exit.3 index b2fa8f2119b..0e0f1765ee8 100644 --- a/lib/libpthread/man/pthread_exit.3 +++ b/lib/libpthread/man/pthread_exit.3 @@ -88,7 +88,6 @@ function cannot return to its caller. None. .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr _exit 2 , .Xr exit 2 , .Xr pthread_create 3 , diff --git a/lib/libpthread/man/pthread_getspecific.3 b/lib/libpthread/man/pthread_getspecific.3 index 73490ae1d5b..acffbfaac2e 100644 --- a/lib/libpthread/man/pthread_getspecific.3 +++ b/lib/libpthread/man/pthread_getspecific.3 @@ -28,8 +28,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: pthread_getspecific.3,v 1.1 1998/08/27 09:00:42 d Exp $ -.\" $OpenBSD: pthread_getspecific.3,v 1.1 1998/08/27 09:00:42 d Exp $ +.\" $FreeBSD: pthread_getspecific.3,v 1.5 1998/08/03 00:58:36 alex Exp $ +.\" $OpenBSD: pthread_getspecific.3,v 1.2 1998/11/09 03:13:15 d Exp $ .\" .Dd April 4, 1996 .Dt PTHREAD_GETSPECIFIC 3 @@ -73,7 +73,6 @@ then the value NULL is returned. .Sh ERRORS None. .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_key_create 3 , .Xr pthread_key_delete 3 , .Xr pthread_setspecific 3 diff --git a/lib/libpthread/man/pthread_join.3 b/lib/libpthread/man/pthread_join.3 index a89878c33f2..d7a28a13053 100644 --- a/lib/libpthread/man/pthread_join.3 +++ b/lib/libpthread/man/pthread_join.3 @@ -91,7 +91,6 @@ specifies the calling thread. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr wait 2 , .Xr pthread_create 3 .Sh STANDARDS diff --git a/lib/libpthread/man/pthread_key_create.3 b/lib/libpthread/man/pthread_key_create.3 index 2d29d10128b..c7c15fd0cef 100644 --- a/lib/libpthread/man/pthread_key_create.3 +++ b/lib/libpthread/man/pthread_key_create.3 @@ -88,7 +88,6 @@ Insufficient memory exists to create the key. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_getspecific 3 , .Xr pthread_key_delete 3 , .Xr pthread_setspecific 3 diff --git a/lib/libpthread/man/pthread_key_delete.3 b/lib/libpthread/man/pthread_key_delete.3 index 6ef3aef9b0b..cf1ad12ae99 100644 --- a/lib/libpthread/man/pthread_key_delete.3 +++ b/lib/libpthread/man/pthread_key_delete.3 @@ -82,7 +82,6 @@ value is invalid. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_getspecific 3 , .Xr pthread_key_create 3 , .Xr pthread_setspecific 3 diff --git a/lib/libpthread/man/pthread_mutex_destroy.3 b/lib/libpthread/man/pthread_mutex_destroy.3 index aa9837c4732..e9fb9c11d04 100644 --- a/lib/libpthread/man/pthread_mutex_destroy.3 +++ b/lib/libpthread/man/pthread_mutex_destroy.3 @@ -59,11 +59,10 @@ is locked by another thread. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_mutex_init 3 , .Xr pthread_mutex_lock 3 , -.Xr pthread_mutex_unlock 3 , -.Xr pthread_mutex_trylock 3 +.Xr pthread_mutex_trylock 3 , +.Xr pthread_mutex_unlock 3 .Sh STANDARDS .Fn pthread_mutex_destroy conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_mutex_init.3 b/lib/libpthread/man/pthread_mutex_init.3 index 9966e16f6be..d5292ff8e10 100644 --- a/lib/libpthread/man/pthread_mutex_init.3 +++ b/lib/libpthread/man/pthread_mutex_init.3 @@ -64,11 +64,10 @@ The temporarily lacks the resources to create another mutex. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_mutex_destroy 3 , .Xr pthread_mutex_lock 3 , -.Xr pthread_mutex_unlock 3 , -.Xr pthread_mutex_trylock 3 +.Xr pthread_mutex_trylock 3 , +.Xr pthread_mutex_unlock 3 .Sh STANDARDS .Fn pthread_mutex_init conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_mutex_lock.3 b/lib/libpthread/man/pthread_mutex_lock.3 index d8cbe96314a..a0aa07d76d6 100644 --- a/lib/libpthread/man/pthread_mutex_lock.3 +++ b/lib/libpthread/man/pthread_mutex_lock.3 @@ -61,11 +61,10 @@ A deadlock would occur if the thread blocked waiting for .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , -.Xr pthread_mutex_unlock 3 , -.Xr pthread_mutex_trylock 3 , +.Xr pthread_mutex_destroy 3 , .Xr pthread_mutex_init 3 , -.Xr pthread_mutex_destroy 3 +.Xr pthread_mutex_trylock 3 , +.Xr pthread_mutex_unlock 3 .Sh STANDARDS .Fn pthread_mutex_lock conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_mutex_trylock.3 b/lib/libpthread/man/pthread_mutex_trylock.3 index 81d2a4dc7e5..9f283801e54 100644 --- a/lib/libpthread/man/pthread_mutex_trylock.3 +++ b/lib/libpthread/man/pthread_mutex_trylock.3 @@ -62,11 +62,10 @@ is already locked. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , -.Xr pthread_mutex_lock 3 , -.Xr pthread_mutex_unlock 3 , +.Xr pthread_mutex_destroy 3 , .Xr pthread_mutex_init 3 , -.Xr pthread_mutex_destroy 3 +.Xr pthread_mutex_lock 3 , +.Xr pthread_mutex_unlock 3 .Sh STANDARDS .Fn pthread_mutex_trylock conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_mutex_unlock.3 b/lib/libpthread/man/pthread_mutex_unlock.3 index 04fb06832d4..95ba7e68511 100644 --- a/lib/libpthread/man/pthread_mutex_unlock.3 +++ b/lib/libpthread/man/pthread_mutex_unlock.3 @@ -61,11 +61,10 @@ The current thread does not hold a lock on .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , -.Xr pthread_mutex_lock 3 , -.Xr pthread_mutex_trylock 3 , +.Xr pthread_mutex_destroy 3 , .Xr pthread_mutex_init 3 , -.Xr pthread_mutex_destroy 3 +.Xr pthread_mutex_lock 3 , +.Xr pthread_mutex_trylock 3 .Sh STANDARDS .Fn pthread_mutex_unlock conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_once.3 b/lib/libpthread/man/pthread_once.3 index c5d0235b41f..fc50d56bf25 100644 --- a/lib/libpthread/man/pthread_once.3 +++ b/lib/libpthread/man/pthread_once.3 @@ -93,8 +93,6 @@ indicate the error. .Sh ERRORS None. .Pp -.Sh SEE ALSO -.Xr pthreads 3 .Sh STANDARDS .Fn pthread_once conforms to ISO/IEC 9945-1 ANSI/IEEE diff --git a/lib/libpthread/man/pthread_rwlock_destroy.3 b/lib/libpthread/man/pthread_rwlock_destroy.3 new file mode 100644 index 00000000000..4e1538a0e5e --- /dev/null +++ b/lib/libpthread/man/pthread_rwlock_destroy.3 @@ -0,0 +1,81 @@ +.\" Copyright (c) 1998 Alex Nash +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id: pthread_rwlock_destroy.3,v 1.1 1998/11/09 03:13:15 d Exp $ +.\" $OpenBSD: pthread_rwlock_destroy.3,v 1.1 1998/11/09 03:13:15 d Exp $ +.\" +.Dd August 4, 1998 +.Dt PTHREAD_RWLOCK_DESTROY 3 +.Os +.Sh NAME +.Nm pthread_rwlock_destroy +.Nd destroy a read/write lock +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft int +.Fn pthread_rwlock_destroy "pthread_rwlock_t *lock" +.Sh DESCRIPTION +The +.Fn pthread_rwlock_destroy +function is used to destroy a read/write lock previously created with +.Fn pthread_rwlock_init . +.Sh RETURN VALUES +If successful, the +.Fn pthread_rwlock_destroy +function will return zero. Otherwise an error number will be returned +to indicate the error. +.Sh SEE ALSO +.Xr pthread_rwlock_init 3 , +.Sh STANDARDS +The +.Fn pthread_rwlock_destroy +function is expected to conform to +.St -susv2 . +.Sh ERRORS +The +.Fn pthread_rwlock_destroy +function will fail if: +.Bl -tag -width Er +.It Bq Er EPERM +The caller does not have the privilege to perform the operation. +.El +.Pp +The +.Fn pthread_rwlock_destroy +function may fail if: +.Bl -tag -width Er +.It Bq Er EBUSY +The system has detected an attempt to destroy the object referenced by +.Fa lock +while it is locked. +.It Bq Er EINVAL +The value specified by +.Fa lock +is invalid. +.El +.Sh HISTORY +The +.Fn pthread_rwlock_destroy +function first appeared in +.Fx 3.0 . diff --git a/lib/libpthread/man/pthread_rwlock_init.3 b/lib/libpthread/man/pthread_rwlock_init.3 new file mode 100644 index 00000000000..6011fe09463 --- /dev/null +++ b/lib/libpthread/man/pthread_rwlock_init.3 @@ -0,0 +1,100 @@ +.\" Copyright (c) 1998 Alex Nash +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id: pthread_rwlock_init.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" $OpenBSD: pthread_rwlock_init.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" +.Dd August 4, 1998 +.Dt PTHREAD_RWLOCK_INIT 3 +.Os +.Sh NAME +.Nm pthread_rwlock_init +.Nd initialize a read/write lock +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft int +.Fn pthread_rwlock_init "pthread_rwlock_t *lock" "const pthread_rwlockattr_t *attr" +.Sh DESCRIPTION +The +.Fn pthread_rwlock_init +function is used to initialize a read/write lock, with attributes +specified by +.Fa attr . +If +.Fa attr +is NULL, the default read/write lock attributes are used. +.Pp +The results of calling +.Fn pthread_rwlock_init +with an already initialized lock are undefined. +.Sh RETURN VALUES +If successful, the +.Fn pthread_rwlock_init +function will return zero. Otherwise an error number will be returned +to indicate the error. +.Sh SEE ALSO +.Xr pthread_rwlock_destroy 3 , +.Xr pthread_rwlockattr_init 3 , +.Xr pthread_rwlockattr_setpshared 3 +.Sh STANDARDS +The +.Fn pthread_rwlock_init +function is expected to conform to +.St -susv2 . +.Sh ERRORS +The +.Fn pthread_rwlock_init +function will fail if: +.Bl -tag -width Er +.It Bq Er EAGAIN +The system lacked the necessary resources (other than memory) to +initialize the lock. +.It Bq Er ENOMEM +Insufficient memory exists to initialize the lock. +.It Bq Er EPERM +The caller does not have sufficient privilege to perform the +operation. +.El +.Pp +The +.Fn pthread_rwlock_init +function may fail if: +.Bl -tag -width Er +.It Bq Er EBUSY +The system has detected an attempt to re-initialize the object +referenced by +.Fa lock , +a previously initialized but not yet destroyed read/write lock. +.It Bq Er EINVAL +The value specified by +.Fa attr +is invalid. +.El +.Sh HISTORY +The +.Fn pthread_rwlock_init +function first appeared in +.Fx 3.0 . +.Sh BUGS +The PTHREAD_PROCESS_SHARED attribute is not supported. diff --git a/lib/libpthread/man/pthread_rwlock_rdlock.3 b/lib/libpthread/man/pthread_rwlock_rdlock.3 new file mode 100644 index 00000000000..6bfd3f9ce74 --- /dev/null +++ b/lib/libpthread/man/pthread_rwlock_rdlock.3 @@ -0,0 +1,123 @@ +.\" Copyright (c) 1998 Alex Nash +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id: pthread_rwlock_rdlock.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" $OpenBSD: pthread_rwlock_rdlock.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" +.Dd August 4, 1998 +.Dt PTHREAD_RWLOCK_RDLOCK 3 +.Os +.Sh NAME +.Nm pthread_rwlock_rdlock , +.Nm pthread_rwlock_tryrdlock +.Nd acquire a read/write lock for reading +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft int +.Fn pthread_rwlock_rdlock "pthread_rwlock_t *lock" +.Ft int +.Fn pthread_rwlock_tryrdlock "pthread_rwlock_t *lock" +.Sh DESCRIPTION +The +.Fn pthread_rwlock_rdlock +function acquires a read lock on +.Fa lock +provided that +.Fa lock +is not presently held for writing and no writer threads are +presently blocked on the lock. If the read lock cannot be +immediately acquired, the calling thread blocks until it can +acquire the lock. +.Pp +The +.Fn pthread_rwlock_tryrdlock +function performs the same action, but does not block if the lock +cannot be immediately obtained (i.e. the lock is held for writing +or there are waiting writers). +.Pp +A thread may hold multiple concurrent read locks. If so, +.Fn pthread_rwlock_unlock +must be called once for each lock obtained. +.Pp +The results of acquiring a read lock while the calling thread holds +a write lock are undefined. +.Sh IMPLEMENTATION NOTES +To prevent writer starvation, writers are favored over readers. +.Sh RETURN VALUES +If successful, the +.Fn pthread_rwlock_rdlock +and +.Fn pthread_rwlock_tryrdlock +functions will return zero. Otherwise an error number will be returned +to indicate the error. +.Sh SEE ALSO +.Xr pthread_rwlock_init 3 , +.Xr pthread_rwlock_trywrlock 3 , +.Xr pthread_rwlock_unlock 3 , +.Xr pthread_rwlock_wrlock 3 +.Sh STANDARDS +The +.Fn pthread_rwlock_rdlock +and +.Fn pthread_rwlock_tryrdlock +functions are expected to conform to +.St -susv2 . +.Sh ERRORS +The +.Fn pthread_rwlock_tryrdlock +function will fail if: +.Bl -tag -width Er +.It Bq Er EBUSY +The lock could not be acquired because a writer holds the lock or +was blocked on it. +.El +.Pp +The +.Fn pthread_rwlock_rdlock +and +.Fn pthread_rwlock_tryrdlock +functions may fail if: +.Bl -tag -width Er +.It Bq Er EAGAIN +The lock could not be acquired because the maximum number of read locks +against +.Fa lock +has been exceeded. +.It Bq Er EDEADLK +The current thread already owns +.Fa lock +for writing. +.It Bq Er EINVAL +The value specified by +.Fa lock +is invalid. +.It Bq Er ENOMEM +Insufficient memory exists to initialize the lock (applies to +statically initialized locks only). +.El +.Sh HISTORY +The +.Fn pthread_rwlock_rdlock +function first appeared in +.Fx 3.0 . diff --git a/lib/libpthread/man/pthread_rwlock_unlock.3 b/lib/libpthread/man/pthread_rwlock_unlock.3 new file mode 100644 index 00000000000..1932429a103 --- /dev/null +++ b/lib/libpthread/man/pthread_rwlock_unlock.3 @@ -0,0 +1,80 @@ +.\" Copyright (c) 1998 Alex Nash +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id: pthread_rwlock_unlock.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" $OpenBSD: pthread_rwlock_unlock.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" +.Dd August 4, 1998 +.Dt PTHREAD_RWLOCK_UNLOCK 3 +.Os +.Sh NAME +.Nm pthread_rwlock_unlock +.Nd release a read/write lock +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft int +.Fn pthread_rwlock_unlock "pthread_rwlock_t *lock" +.Sh DESCRIPTION +The +.Fn pthread_rwlock_unlock +function is used to release the read/write lock previously obtained by +.Fn pthread_rwlock_rdlock , +.Fn pthread_rwlock_wrlock , +.Fn pthread_rwlock_tryrdlock , +or +.Fn pthread_rwlock_trywrlock . +.Sh RETURN VALUES +If successful, the +.Fn pthread_rwlock_unlock +function will return zero. Otherwise an error number will be returned +to indicate the error. +.Pp +The results are undefined if +.Fa lock +is not held by the calling thread. +.Sh SEE ALSO +.Xr pthread_rwlock_rdlock 3 , +.Xr pthread_rwlock_wrlock 3 +.Sh STANDARDS +The +.Fn pthread_rwlock_unlock +function is expected to conform to +.St -susv2 . +.Sh ERRORS +The +.Fn pthread_rwlock_unlock +function may fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value specified by +.Fa lock +is invalid. +.It Bq Er EPERM +The current thread does not own the read/write lock. +.El +.Sh HISTORY +The +.Fn pthread_rwlock_unlock +function first appeared in +.Fx 3.0 . diff --git a/lib/libpthread/man/pthread_rwlock_wrlock.3 b/lib/libpthread/man/pthread_rwlock_wrlock.3 new file mode 100644 index 00000000000..881e00c856d --- /dev/null +++ b/lib/libpthread/man/pthread_rwlock_wrlock.3 @@ -0,0 +1,103 @@ +.\" Copyright (c) 1998 Alex Nash +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id: pthread_rwlock_wrlock.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" $OpenBSD: pthread_rwlock_wrlock.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" +.Dd August 4, 1998 +.Dt PTHREAD_RWLOCK_WRLOCK 3 +.Os +.Sh NAME +.Nm pthread_rwlock_wrlock , +.Nm pthread_rwlock_trywrlock +.Nd acquire a read/write lock for writing +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft int +.Fn pthread_rwlock_wrlock "pthread_rwlock_t *lock" +.Ft int +.Fn pthread_rwlock_trywrlock "pthread_rwlock_t *lock" +.Sh DESCRIPTION +The +.Fn pthread_rwlock_wrlock +function blocks until a write lock can be acquired against +.Fa lock . +The +.Fn pthread_rwlock_trywrlock +function performs the same action, but does not block if the lock +cannot be immediately obtained. +.Pp +The results are undefined if the calling thread already holds the +lock at the time the call is made. +.Sh IMPLEMENTATION NOTES +To prevent writer starvation, writers are favored over readers. +.Sh RETURN VALUES +If successful, the +.Fn pthread_rwlock_wrlock +and +.Fn pthread_rwlock_trywrlock +functions will return zero. Otherwise an error number will be returned +to indicate the error. +.Sh SEE ALSO +.Xr pthread_rwlock_trywrlock 3 , +.Xr pthread_rwlock_unlock 3 , +.Xr pthread_rwlock_wrlock 3 +.Sh STANDARDS +The +.Fn pthread_rwlock_wrlock +and +.Fn pthread_rwlock_trywrlock +functions are expected to conform to +.St -susv2 . +.Sh ERRORS +The +.Fn pthread_rwlock_trywrlock +function will fail if: +.Bl -tag -width Er +.It Bq Er EBUSY +The calling thread is not able to acquire the lock without blocking. +.El +.Pp +The +.Fn pthread_rwlock_wrlock +and +.Fn pthread_rwlock_trywrlock +functions may fail if: +.Bl -tag -width Er +.It Bq Er EDEADLK +The calling thread already owns the read/write lock (for reading +or writing). +.It Bq Er EINVAL +The value specified by +.Fa lock +is invalid. +.It Bq Er ENOMEM +Insufficient memory exists to initialize the lock (applies to +statically initialized locks only). +.El +.Sh HISTORY +The +.Fn pthread_rwlock_wrlock +function first appeared in +.Fx 3.0 . diff --git a/lib/libpthread/man/pthread_rwlockattr_destroy.3 b/lib/libpthread/man/pthread_rwlockattr_destroy.3 new file mode 100644 index 00000000000..8deab9d214c --- /dev/null +++ b/lib/libpthread/man/pthread_rwlockattr_destroy.3 @@ -0,0 +1,69 @@ +.\" Copyright (c) 1998 Alex Nash +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id: pthread_rwlockattr_destroy.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" $OpenBSD: pthread_rwlockattr_destroy.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" +.Dd August 4, 1998 +.Dt PTHREAD_RWLOCKATTR_DESTROY 3 +.Os +.Sh NAME +.Nm pthread_rwlockattr_destroy +.Nd destroy a read/write lock +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft int +.Fn pthread_rwlockattr_destroy "pthread_rwlockattr_t *attr" +.Sh DESCRIPTION +The +.Fn pthread_rwlockattr_destroy +function is used to destroy a read/write lock attribute object +previously created with +.Fn pthread_rwlockattr_init . +.Sh RETURN VALUES +If successful, the +.Fn pthread_rwlockattr_destroy +function will return zero. Otherwise an error number will be returned +to indicate the error. +.Sh SEE ALSO +.Xr pthread_rwlockattr_init 3 , +.Sh STANDARDS +The +.Fn pthread_rwlockattr_destroy +function is expected to conform to +.St -susv2 . +.Sh ERRORS +.Fn pthread_rwlockattr_destroy +may fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value specified by +.Fa attr +is invalid. +.El +.Sh HISTORY +The +.Fn pthread_rwlockattr_destroy +function first appeared in +.Fx 3.0 . diff --git a/lib/libpthread/man/pthread_rwlockattr_getpshared.3 b/lib/libpthread/man/pthread_rwlockattr_getpshared.3 new file mode 100644 index 00000000000..de98aab2f5f --- /dev/null +++ b/lib/libpthread/man/pthread_rwlockattr_getpshared.3 @@ -0,0 +1,81 @@ +.\" Copyright (c) 1998 Alex Nash +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id: pthread_rwlockattr_getpshared.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" $OpenBSD: pthread_rwlockattr_getpshared.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" +.Dd August 4, 1998 +.Dt PTHREAD_RWLOCKATTR_GETPSHARED 3 +.Os +.Sh NAME +.Nm pthread_rwlockattr_getpshared +.Nd set the process shared attribute +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft int +.Fn pthread_rwlockattr_getpshared "pthread_rwlockattr_t *attr" "int *pshared" +.Sh DESCRIPTION +The +.Fn pthread_rwlockattr_getpshared +function is used to get the process shared setting of a read/write +lock attribute object. The setting is returned via +.Fa pshared , +and may be one of two values: +.Bl -hang -offset flag -width 123456789012345678901234 +.It Ar PTHREAD_PROCESS_SHARED +Any thread of any process that has access to the memory where the +read/write lock resides can manipulate the lock. +.It Ar PTHREAD_PROCESS_PRIVATE +Only threads created within the same process as the thread that +initialized the read/write lock can manipulate the lock. This is +the default value. +.El +.Sh RETURN VALUES +If successful, the +.Fn pthread_rwlockattr_getpshared +function will return zero. Otherwise an error number will be returned +to indicate the error. +.Sh SEE ALSO +.Xr pthread_rwlock_init 3 , +.Xr pthread_rwlockattr_init 3 , +.Xr pthread_rwlockattr_setpshared 3 +.Sh STANDARDS +The +.Fn pthread_rwlockattr_getpshared +function is expected to conform to +.St -susv2 . +.Sh ERRORS +.Fn pthread_rwlockattr_getpshared +may fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value specified by +.Fa attr +is invalid. +.El +.Sh HISTORY +The +.Fn pthread_rwlockattr_getpshared +function first appeared in +.Fx 3.0 . diff --git a/lib/libpthread/man/pthread_rwlockattr_init.3 b/lib/libpthread/man/pthread_rwlockattr_init.3 new file mode 100644 index 00000000000..ff03334d5e5 --- /dev/null +++ b/lib/libpthread/man/pthread_rwlockattr_init.3 @@ -0,0 +1,68 @@ +.\" Copyright (c) 1998 Alex Nash +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id: pthread_rwlockattr_init.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" $OpenBSD: pthread_rwlockattr_init.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" +.Dd August 4, 1998 +.Dt PTHREAD_RWLOCKATTR_INIT 3 +.Os +.Sh NAME +.Nm pthread_rwlockattr_init +.Nd initialize a read/write lock +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft int +.Fn pthread_rwlockattr_init "pthread_rwlockattr_t *attr" +.Sh DESCRIPTION +The +.Fn pthread_rwlockattr_init +function is used to initialize a read/write lock attributes object. +.Sh RETURN VALUES +If successful, the +.Fn pthread_rwlockattr_init +function will return zero. Otherwise an error number will be returned +to indicate the error. +.Sh SEE ALSO +.Xr pthread_rwlock_init 3 , +.Xr pthread_rwlockattr_destroy 3 , +.Xr pthread_rwlockattr_getpshared 3 +.Xr pthread_rwlockattr_setpshared 3 +.Sh STANDARDS +The +.Fn pthread_rwlockattr_init +function is expected to conform to +.St -susv2 . +.Sh ERRORS +.Fn pthread_rwlockattr_init +will fail if: +.Bl -tag -width Er +.It Bq Er ENOMEM +Insufficient memory exists to initialize the attribute object. +.El +.Sh HISTORY +The +.Fn pthread_rwlockattr_init +function first appeared in +.Fx 3.0 . diff --git a/lib/libpthread/man/pthread_rwlockattr_setpshared.3 b/lib/libpthread/man/pthread_rwlockattr_setpshared.3 new file mode 100644 index 00000000000..b6b42ca38f8 --- /dev/null +++ b/lib/libpthread/man/pthread_rwlockattr_setpshared.3 @@ -0,0 +1,87 @@ +.\" Copyright (c) 1998 Alex Nash +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id: pthread_rwlockattr_setpshared.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" $OpenBSD: pthread_rwlockattr_setpshared.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.\" +.Dd August 4, 1998 +.Dt PTHREAD_RWLOCKATTR_SETPSHARED 3 +.Os +.Sh NAME +.Nm pthread_rwlockattr_setpshared +.Nd set the process shared attribute +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft int +.Fn pthread_rwlockattr_setpshared "pthread_rwlockattr_t *attr" "int *pshared" +.Sh DESCRIPTION +The +.Fn pthread_rwlockattr_setpshared +function sets the process shared attribute of +.Fa attr +to the value referenced by +.Fa pshared . +.Fa pshared +may be one of two values: +.Bl -hang -offset flag -width 123456789012345678901234 +.It Ar PTHREAD_PROCESS_SHARED +Any thread of any process that has access to the memory where the +read/write lock resides can manipulate the lock. +.It Ar PTHREAD_PROCESS_PRIVATE +Only threads created within the same process as the thread that +initialized the read/write lock can manipulate the lock. This is +the default value. +.El +.Sh RETURN VALUES +If successful, the +.Fn pthread_rwlockattr_setpshared +function will return zero. Otherwise an error number will be returned +to indicate the error. +.Sh SEE ALSO +.Xr pthread_rwlock_init 3 , +.Xr pthread_rwlockattr_init 3 , +.Xr pthread_rwlockattr_setpshared 3 +.Sh STANDARDS +The +.Fn pthread_rwlockattr_setpshared +function is expected to conform to +.St -susv2 . +.Sh ERRORS +.Fn pthread_rwlockattr_setpshared +will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value specified by +.Fa attr +or +.Fa pshared +is invalid. +.El +.Sh HISTORY +The +.Fn pthread_rwlockattr_setpshared +function first appeared in +.Fx 3.0 . +.Sh BUGS +The PTHREAD_PROCESS_SHARED attribute is not supported. diff --git a/lib/libpthread/man/pthread_self.3 b/lib/libpthread/man/pthread_self.3 index 63cf2dfdafb..46c118af09f 100644 --- a/lib/libpthread/man/pthread_self.3 +++ b/lib/libpthread/man/pthread_self.3 @@ -50,7 +50,6 @@ function returns the thread ID of the calling thread. None. .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_create 3 , .Xr pthread_equal 3 .Sh STANDARDS diff --git a/lib/libpthread/man/pthread_setspecific.3 b/lib/libpthread/man/pthread_setspecific.3 index 448e1872f58..e28cf568213 100644 --- a/lib/libpthread/man/pthread_setspecific.3 +++ b/lib/libpthread/man/pthread_setspecific.3 @@ -81,7 +81,6 @@ value is invalid. .El .Pp .Sh SEE ALSO -.Xr pthreads 3 , .Xr pthread_getspecific 3 , .Xr pthread_key_create 3 , .Xr pthread_key_delete 3 diff --git a/lib/libpthread/man/pwrite.3 b/lib/libpthread/man/pwrite.3 new file mode 100644 index 00000000000..d8e56f9327b --- /dev/null +++ b/lib/libpthread/man/pwrite.3 @@ -0,0 +1,36 @@ +.\" $OpenBSD: pwrite.3,v 1.1 1998/11/09 03:13:16 d Exp $ +.Dd September 7, 1998 +.Os Ox +.Dt PWRITE 3 +.Sh NAME +.Nm pwrite +.Nd atomic seek and write +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft ssize_t +.Fn pwrite "int filedes" "void *buf" "size_t nbytes" "off_t offset" +.Sh DESCRIPTION +The +.Fn pwrite +function writes +.Fa nbyte +bytes from offset +.Fa offset +in the file opened on file descriptor +.Fa filedes. +.Pp +This function is provided for use in a threaded, parallel I/O +environment, where race conditions may exist between two threads +non-atomically seeking and writing to the same file descriptor. +.Sh RETURN VALUES +The +.Fn pread +function returns values identical to +.Xr write 3 . +.Sh SEE ALSO +.Xr pthreads 3 , +.Xr write 3 , +.Xr pread 3 +.Sh STANDARDS +.Fn pread +conforms to TOG SUSv2 . |