xref: /freebsd/share/man/man3/pthread_rwlockattr_getpshared.3 (revision 9cbda59000e0f366b04c83d8d852c7c34b467722)
1c0e36632SAlexander Langer.\" Copyright (c) 1998 Alex Nash
2c0e36632SAlexander Langer.\" All rights reserved.
3c0e36632SAlexander Langer.\"
4c0e36632SAlexander Langer.\" Redistribution and use in source and binary forms, with or without
5c0e36632SAlexander Langer.\" modification, are permitted provided that the following conditions
6c0e36632SAlexander Langer.\" are met:
7c0e36632SAlexander Langer.\" 1. Redistributions of source code must retain the above copyright
8c0e36632SAlexander Langer.\"    notice, this list of conditions and the following disclaimer.
9c0e36632SAlexander Langer.\" 2. Redistributions in binary form must reproduce the above copyright
10c0e36632SAlexander Langer.\"    notice, this list of conditions and the following disclaimer in the
11c0e36632SAlexander Langer.\"    documentation and/or other materials provided with the distribution.
12c0e36632SAlexander Langer.\"
13c0e36632SAlexander Langer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14c0e36632SAlexander Langer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15c0e36632SAlexander Langer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16c0e36632SAlexander Langer.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17c0e36632SAlexander Langer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18c0e36632SAlexander Langer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19c0e36632SAlexander Langer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20c0e36632SAlexander Langer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21c0e36632SAlexander Langer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22c0e36632SAlexander Langer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23c0e36632SAlexander Langer.\" SUCH DAMAGE.
24c0e36632SAlexander Langer.\"
257f3dea24SPeter Wemm.\" $FreeBSD$
26c0e36632SAlexander Langer.\"
27da69a97fSAlexander Langer.Dd March 22, 1999
28c0e36632SAlexander Langer.Dt PTHREAD_RWLOCKATTR_GETPSHARED 3
29c0e36632SAlexander Langer.Os
30c0e36632SAlexander Langer.Sh NAME
31c0e36632SAlexander Langer.Nm pthread_rwlockattr_getpshared
32da69a97fSAlexander Langer.Nd get the process shared attribute
33d8a78688SAlexey Zelkin.Sh LIBRARY
34d8a78688SAlexey Zelkin.Lb libc_r
35ec7452f1SRuslan Ermilov.Lb libpthread
36f9f9d2e8SRuslan Ermilov.Lb libthr
37c0e36632SAlexander Langer.Sh SYNOPSIS
3832eef9aeSRuslan Ermilov.In pthread.h
39c0e36632SAlexander Langer.Ft int
40dcb964faSBruce Evans.Fn pthread_rwlockattr_getpshared "const pthread_rwlockattr_t *attr" "int *pshared"
41c0e36632SAlexander Langer.Sh DESCRIPTION
42c0e36632SAlexander LangerThe
43c0e36632SAlexander Langer.Fn pthread_rwlockattr_getpshared
44c0e36632SAlexander Langerfunction is used to get the process shared setting of a read/write
455203edcdSRuslan Ermilovlock attribute object.
465203edcdSRuslan ErmilovThe setting is returned via
47c0e36632SAlexander Langer.Fa pshared ,
48c0e36632SAlexander Langerand may be one of two values:
490d42ab24SRuslan Ermilov.Bl -tag -width PTHREAD_PROCESS_PRIVATE
500d42ab24SRuslan Ermilov.It Dv PTHREAD_PROCESS_SHARED
51c0e36632SAlexander LangerAny thread of any process that has access to the memory where the
52c0e36632SAlexander Langerread/write lock resides can manipulate the lock.
530d42ab24SRuslan Ermilov.It Dv PTHREAD_PROCESS_PRIVATE
54c0e36632SAlexander LangerOnly threads created within the same process as the thread that
555203edcdSRuslan Ermilovinitialized the read/write lock can manipulate the lock.
565203edcdSRuslan ErmilovThis is
57c0e36632SAlexander Langerthe default value.
58c0e36632SAlexander Langer.El
59c0e36632SAlexander Langer.Sh RETURN VALUES
60c0e36632SAlexander LangerIf successful, the
61c0e36632SAlexander Langer.Fn pthread_rwlockattr_getpshared
625203edcdSRuslan Ermilovfunction will return zero.
635203edcdSRuslan ErmilovOtherwise an error number will be returned
64c0e36632SAlexander Langerto indicate the error.
65c0e36632SAlexander Langer.Sh ERRORS
669d09157aSPhilippe CharnierThe
67c0e36632SAlexander Langer.Fn pthread_rwlockattr_getpshared
689d09157aSPhilippe Charnierfunction may fail if:
69c0e36632SAlexander Langer.Bl -tag -width Er
70c0e36632SAlexander Langer.It Bq Er EINVAL
71c0e36632SAlexander LangerThe value specified by
72c0e36632SAlexander Langer.Fa attr
73c0e36632SAlexander Langeris invalid.
74c0e36632SAlexander Langer.El
759cbda590SRuslan Ermilov.Sh SEE ALSO
769cbda590SRuslan Ermilov.Xr pthread_rwlockattr_init 3 ,
779cbda590SRuslan Ermilov.Xr pthread_rwlockattr_setpshared 3 ,
789cbda590SRuslan Ermilov.Xr pthread_rwlock_init 3
799cbda590SRuslan Ermilov.Sh STANDARDS
809cbda590SRuslan ErmilovThe
819cbda590SRuslan Ermilov.Fn pthread_rwlockattr_getpshared
829cbda590SRuslan Ermilovfunction is expected to conform to
839cbda590SRuslan Ermilov.St -susv2 .
84c0e36632SAlexander Langer.Sh HISTORY
85c0e36632SAlexander LangerThe
86c0e36632SAlexander Langer.Fn pthread_rwlockattr_getpshared
87c0e36632SAlexander Langerfunction first appeared in
88c0e36632SAlexander Langer.Fx 3.0 .
89