1.\" $NetBSD: pthread_rwlockattr.3,v 1.4 2003/07/04 08:36:06 wiz Exp $ 2.\" 3.\" Copyright (c) 2002 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. Neither the name of The NetBSD Foundation nor the names of its 14.\" contributors may be used to endorse or promote products derived 15.\" from this software without specific prior written permission. 16.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 17.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 20.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26.\" POSSIBILITY OF SUCH DAMAGE. 27.\" 28.\" Copyright (c) 1998 Alex Nash 29.\" All rights reserved. 30.\" 31.\" Redistribution and use in source and binary forms, with or without 32.\" modification, are permitted provided that the following conditions 33.\" are met: 34.\" 1. Redistributions of source code must retain the above copyright 35.\" notice, this list of conditions and the following disclaimer. 36.\" 2. Redistributions in binary form must reproduce the above copyright 37.\" notice, this list of conditions and the following disclaimer in the 38.\" documentation and/or other materials provided with the distribution. 39.\" 40.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 41.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 43.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 44.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 45.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 46.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 48.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 49.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 50.\" SUCH DAMAGE. 51.\" 52.\" $FreeBSD: src/lib/libpthread/man/pthread_rwlockattr_init.3,v 1.7 2002/09/16 19:29:29 mini Exp $ 53.\" 54.Dd January 30, 2003 55.Dt PTHREAD_RWLOCKATTR 3 56.Os 57.Sh NAME 58.Nm pthread_rwlockattr_init , 59.Nm pthread_rwlockattr_destroy 60.Nd initialize or destroy read/write lock attributes 61.Sh LIBRARY 62.Lb libpthread 63.Sh SYNOPSIS 64.In pthread.h 65.Ft int 66.Fn pthread_rwlockattr_init "pthread_rwlockattr_t *attr" 67.Ft int 68.Fn pthread_rwlockattr_destroy "pthread_rwlockattr_t *attr" 69.Sh DESCRIPTION 70The 71.Fn pthread_rwlockattr_init 72function is used to initialize a read/write lock attributes object. 73.Pp 74The 75.Fn pthread_rwlockattr_destroy 76function is used to destroy a read/write lock attribute object 77previously created with 78.Fn pthread_rwlockattr_init . 79.Sh RETURN VALUES 80If successful, the 81.Fn pthread_rwlockattr_init 82and 83.Fn pthread_rwlockattr_destroy 84functions return zero. Otherwise an error number will be returned 85to indicate the error. 86.Sh ERRORS 87.Fn pthread_rwlockattr_init 88shall fail if: 89.Bl -tag -width Er 90.It Bq Er ENOMEM 91Insufficent memory exists to initialize the read/write lock attributes object. 92.El 93.Pp 94.Fn pthread_rwlockattr_init 95and 96.Fn pthread_rwlockattr_destroy 97may fail if: 98.Bl -tag -width Er 99.It Bq Er EINVAL 100The value specified by 101.Fa attr 102is invalid. 103.El 104.Sh SEE ALSO 105.Xr pthread_rwlock_init 3 106.Sh STANDARDS 107The 108.Fn pthread_rwlockattr_init 109and 110.Fn pthread_rwlockattr_destroy 111functions conform to 112.St -p1003.1-96 . 113