nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man3c / pthread_barrierattr_getpshared.3c
blob87c1b60167e32a69b0412df8cdd71a0adf283732
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 (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
44 .\" Portions Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
45 .\"
46 .TH PTHREAD_BARRIERATTR_GETPSHARED 3C "Jan 30, 2004"
47 .SH NAME
48 pthread_barrierattr_getpshared, pthread_barrierattr_setpshared \- get and set
49 process-shared attribute of barrier attributes object
50 .SH SYNOPSIS
51 .LP
52 .nf
53 cc \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
54 #include <pthread.h>
56 \fBint\fR \fBpthread_barrierattr_getpshared\fR(
57      \fBconst pthread_barrierattr_t *restrict\fR \fIattr\fR,
58      \fBint *restrict\fR \fIpshared\fR);
59 .fi
61 .LP
62 .nf
63 \fBint\fR \fBpthread_barrierattr_setpshared\fR(\fBpthread_barrierattr_t *\fR\fIattr\fR,
64      \fBint\fR \fIpshared\fR);
65 .fi
67 .SH DESCRIPTION
68 .sp
69 .LP
70 The \fBpthread_barrierattr_getpshared()\fR function obtains the value of the
71 \fIprocess-shared\fR attribute from the attributes object referenced by
72 \fIattr\fR. The \fBpthread_barrierattr_setpshared()\fR function sets the
73 \fIprocess-shared\fR attribute in an initialized attributes object referenced
74 by \fIattr\fR.
75 .sp
76 .LP
77 The \fIprocess-shared\fR attribute is set to \fBPTHREAD_PROCESS_SHARED\fR to
78 permit a barrier to be operated upon by any thread that has access to the
79 memory where the barrier is allocated. If the \fIprocess-shared\fR attribute is
80 \fBPTHREAD_PROCESS_PRIVATE\fR, the barrier will only be operated upon by
81 threads created within the same process as the thread that initialized the
82 barrier. If threads of different processes attempt to operate on such a
83 barrier, the behavior is undefined.
84 .sp
85 .LP
86 The default value of the attribute is \fBPTHREAD_PROCESS_PRIVATE\fR. Both
87 constants \fBPTHREAD_PROCESS_SHARED\fR and \fBPTHREAD_PROCESS_PRIVATE\fR are
88 defined in <\fBpthread.h\fR>.
89 .sp
90 .LP
91 No barrier attributes other than the \fIprocess-shared\fR attribute are
92 provided.
93 .SH RETURN VALUES
94 .sp
95 .LP
96 Upon successful completion, the \fBpthread_barrierattr_getpshared()\fR function
97 returns 0 and stores the value of the \fIprocess-shared\fR attribute of
98 \fIattr\fR into the object referenced by the \fIpshared\fR parameter.
99 Otherwise, an error number is returned to indicate the error.
102 Upon successful completion, the \fBpthread_barrierattr_setpshared()\fR function
103 returns 0. Otherwise, an error number is returned to indicate the error.
104 .SH ERRORS
107 These functions may fail if:
109 .ne 2
111 \fB\fBEINVAL\fR\fR
113 .RS 10n
114 The value specified by \fIattr\fR is invalid.
119 The \fBpthread_barrierattr_setpshared()\fR function may fail if:
121 .ne 2
123 \fB\fBEINVAL\fR\fR
125 .RS 10n
126 The new value specified for the \fIprocess-shared\fR attribute is not one of
127 the legal values \fBPTHREAD_PROCESS_SHARED\fR or \fBPTHREAD_PROCESS_PRIVATE\fR.
130 .SH ATTRIBUTES
133 See \fBattributes\fR(5) for descriptions of the following attributes:
138 box;
139 c | c
140 l | l .
141 ATTRIBUTE TYPE  ATTRIBUTE VALUE
143 Interface Stability     Standard
145 MT-Level        MT-Safe
148 .SH SEE ALSO
151 \fBpthread_barrier_init\fR(3C), \fBpthread_barrierattr_destroy\fR(3C),
152 \fBattributes\fR(5), \fBstandards\fR(5)