8999 SMBIOS: cleanup 32-bit specific code
[unleashed.git] / usr / src / man / man3c / pthread_barrierattr_getpshared.3c
blob34c4c631565b386d720328a102de94a8b48f1c7f
1 '\" te
2 .\" Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
3 .\" Portions Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
4 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
7 .\"  This notice shall appear on any product containing this material.
8 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
9 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
10 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
11 .TH PTHREAD_BARRIERATTR_GETPSHARED 3C "Jan 30, 2004"
12 .SH NAME
13 pthread_barrierattr_getpshared, pthread_barrierattr_setpshared \- get and set
14 process-shared attribute of barrier attributes object
15 .SH SYNOPSIS
16 .LP
17 .nf
18 cc \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
19 #include <pthread.h>
21 \fBint\fR \fBpthread_barrierattr_getpshared\fR(
22      \fBconst pthread_barrierattr_t *restrict\fR \fIattr\fR,
23      \fBint *restrict\fR \fIpshared\fR);
24 .fi
26 .LP
27 .nf
28 \fBint\fR \fBpthread_barrierattr_setpshared\fR(\fBpthread_barrierattr_t *\fR\fIattr\fR,
29      \fBint\fR \fIpshared\fR);
30 .fi
32 .SH DESCRIPTION
33 .sp
34 .LP
35 The \fBpthread_barrierattr_getpshared()\fR function obtains the value of the
36 \fIprocess-shared\fR attribute from the attributes object referenced by
37 \fIattr\fR. The \fBpthread_barrierattr_setpshared()\fR function sets the
38 \fIprocess-shared\fR attribute in an initialized attributes object referenced
39 by \fIattr\fR.
40 .sp
41 .LP
42 The \fIprocess-shared\fR attribute is set to \fBPTHREAD_PROCESS_SHARED\fR to
43 permit a barrier to be operated upon by any thread that has access to the
44 memory where the barrier is allocated. If the \fIprocess-shared\fR attribute is
45 \fBPTHREAD_PROCESS_PRIVATE\fR, the barrier will only be operated upon by
46 threads created within the same process as the thread that initialized the
47 barrier. If threads of different processes attempt to operate on such a
48 barrier, the behavior is undefined.
49 .sp
50 .LP
51 The default value of the attribute is \fBPTHREAD_PROCESS_PRIVATE\fR. Both
52 constants \fBPTHREAD_PROCESS_SHARED\fR and \fBPTHREAD_PROCESS_PRIVATE\fR are
53 defined in <\fBpthread.h\fR>.
54 .sp
55 .LP
56 No barrier attributes other than the \fIprocess-shared\fR attribute are
57 provided.
58 .SH RETURN VALUES
59 .sp
60 .LP
61 Upon successful completion, the \fBpthread_barrierattr_getpshared()\fR function
62 returns 0 and stores the value of the \fIprocess-shared\fR attribute of
63 \fIattr\fR into the object referenced by the \fIpshared\fR parameter.
64 Otherwise, an error number is returned to indicate the error.
65 .sp
66 .LP
67 Upon successful completion, the \fBpthread_barrierattr_setpshared()\fR function
68 returns 0. Otherwise, an error number is returned to indicate the error.
69 .SH ERRORS
70 .sp
71 .LP
72 These functions may fail if:
73 .sp
74 .ne 2
75 .na
76 \fB\fBEINVAL\fR\fR
77 .ad
78 .RS 10n
79 The value specified by \fIattr\fR is invalid.
80 .RE
82 .sp
83 .LP
84 The \fBpthread_barrierattr_setpshared()\fR function may fail if:
85 .sp
86 .ne 2
87 .na
88 \fB\fBEINVAL\fR\fR
89 .ad
90 .RS 10n
91 The new value specified for the \fIprocess-shared\fR attribute is not one of
92 the legal values \fBPTHREAD_PROCESS_SHARED\fR or \fBPTHREAD_PROCESS_PRIVATE\fR.
93 .RE
95 .SH ATTRIBUTES
96 .sp
97 .LP
98 See \fBattributes\fR(5) for descriptions of the following attributes:
99 .sp
103 box;
104 c | c
105 l | l .
106 ATTRIBUTE TYPE  ATTRIBUTE VALUE
108 Interface Stability     Standard
110 MT-Level        MT-Safe
113 .SH SEE ALSO
116 \fBpthread_barrier_init\fR(3C), \fBpthread_barrierattr_destroy\fR(3C),
117 \fBattributes\fR(5), \fBstandards\fR(5)