9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / pthread_rwlockattr_getpshared.3c
blob316edd8f7f3818155cc6c32bfb4140016c061b56
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1991, 1992, 1994, The X/Open Company Ltd.
44 .\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
45 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
46 .\"
47 .TH PTHREAD_RWLOCKATTR_GETPSHARED 3C "Mar 23, 2005"
48 .SH NAME
49 pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared \- get or set
50 process-shared attribute of read-write lock attributes object
51 .SH SYNOPSIS
52 .LP
53 .nf
54 cc -mt [ \fIflag\fR... ] \fIfile\fR... -lpthread [ \fIlibrary\fR... ]
55 #include <pthread.h>
57 \fBint\fR \fBpthread_rwlockattr_getpshared\fR(
58      \fBconst pthread_rwlockattr_t *restrict\fR \fIattr\fR,
59      \fBint *restrict\fR \fIpshared\fR);
60 .fi
62 .LP
63 .nf
64 \fBint\fR \fBpthread_rwlockattr_setpshared\fR(\fBpthread_rwlockattr_t *\fR\fIattr\fR,
65      \fBint\fR \fIpshared\fR);
66 .fi
68 .SH DESCRIPTION
69 .sp
70 .LP
71 The \fIprocess-shared\fR attribute is set to  \fBPTHREAD_PROCESS_SHARED\fR to
72 permit a read-write lock to be operated upon by any thread that has access to
73 the memory where the read-write lock is allocated,  even if the read-write lock
74 is allocated in memory that is shared by multiple processes. If the
75 \fIprocess-shared\fR attribute is  \fBPTHREAD_PROCESS_PRIVATE,\fR the
76 read-write lock will only be operated upon by threads created within the same
77 process as the thread that initialised the read-write lock; if threads of
78 differing processes attempt to operate on such a read-write lock, the behaviour
79 is undefined. The default value of the \fIprocess-shared\fR attribute is
80 \fBPTHREAD_PROCESS_PRIVATE.\fR
81 .sp
82 .LP
83 The \fBpthread_rwlockattr_getpshared()\fR function obtains the value of the
84 \fIprocess-shared\fR attribute from the initialised attributes object
85 referenced by \fIattr\fR. The  \fBpthread_rwlockattr_setpshared()\fR function
86 is used to set the \fIprocess-shared\fR attribute in an initialised attributes
87 object referenced by attr.
88 .SH RETURN VALUES
89 .sp
90 .LP
91 If successful, the  \fBpthread_rwlockattr_setpshared()\fR function returns
92 \fB0\fR. Otherwise, an error number is returned to indicate the error.
93 .sp
94 .LP
95 Upon successful completion, the  \fBpthread_rwlockattr_getpshared()\fR returns
96 \fB0\fR and stores the value of the \fIprocess-shared\fR attribute of
97 \fIattr\fR into the object referenced by the \fIpshared\fR parameter. Otherwise
98 an error number is returned to indicate the error.
99 .SH ERRORS
102 The \fBpthread_rwlockattr_getpshared()\fR and
103 \fBpthread_rwlockattr_setpshared()\fR functions will fail if:
105 .ne 2
107 \fB\fBEINVAL\fR\fR
109 .RS 10n
110 The value specified by \fIattr\fR  or \fIpshared\fR is invalid.
113 .SH ATTRIBUTES
116 See  \fBattributes\fR(5) for descriptions of the following attributes:
121 box;
122 c | c
123 l | l .
124 ATTRIBUTE TYPE  ATTRIBUTE VALUE
126 Interface Stability     Standard
128 MT-Level        MT-Safe
131 .SH SEE ALSO
134 \fBpthread_rwlock_init\fR(3C), \fBpthread_rwlock_rdlock\fR(3C),
135 \fBpthread_rwlock_unlock\fR(3C), \fBpthread_rwlock_wrlock\fR(3C),
136 \fBpthread_rwlockattr_init\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)