Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man3c / pthread_condattr_getpshared.3c
blob0d761be9d2fa459159519814142942e2cd90643c
1 '\" te
2 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
4 .\" Copyright 1991, 1992, 1994, The X/Open Company Ltd.
5 .\" 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
6 .\" http://www.opengroup.org/bookstore/.
7 .\" 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.
8 .\"  This notice shall appear on any product containing this material.
9 .\" 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.
10 .\" 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.
11 .\" 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]
12 .TH PTHREAD_CONDATTR_GETPSHARED 3C "Mar 23, 2005"
13 .SH NAME
14 pthread_condattr_getpshared, pthread_condattr_setpshared \- get or set
15 process-shared condition variable attributes
16 .SH SYNOPSIS
17 .LP
18 .nf
19 cc -mt [ \fIflag\fR... ] \fIfile\fR... -lpthread [ \fIlibrary\fR... ]
20 #include <pthread.h>
22 \fBint\fR \fBpthread_condattr_getpshared\fR(
23      \fBconst pthread_condattr_t *restrict\fR \fIattr\fR,
24      \fBint *restrict\fR \fIpshared\fR);
25 .fi
27 .LP
28 .nf
29 \fBint\fR \fBpthread_condattr_setpshared\fR(\fBpthread_condattr_t *\fR\fIattr\fR,
30      \fBint\fR \fIpshared\fR);
31 .fi
33 .SH DESCRIPTION
34 .sp
35 .LP
36 The \fBpthread_condattr_getpshared()\fR function obtains the value of the
37 \fIprocess-shared\fR attribute from the attributes object referenced by
38 \fIattr\fR. The \fBpthread_condattr_setpshared()\fR function is used to set the
39 \fIprocess-shared\fR attribute in an initialized attributes object referenced
40 by \fIattr\fR.
41 .sp
42 .LP
43 The \fIprocess-shared\fR attribute is set to  \fBPTHREAD_PROCESS_SHARED\fR to
44 permit a condition variable to be operated upon by any thread that has access
45 to the memory where the condition variable is allocated, even if the condition
46 variable is allocated in memory that is shared by multiple processes. If the
47 \fIprocess-shared\fR attribute is  \fBPTHREAD_PROCESS_PRIVATE,\fR the condition
48 variable will only be operated upon by threads created within the same process
49 as the thread that initialized the condition variable; if threads of differing
50 processes attempt to operate on such a condition variable, the behavior is
51 undefined.  The default value of the attribute is
52 \fBPTHREAD_PROCESS_PRIVATE.\fR
53 .sp
54 .LP
55 Additional attributes, their default values, and the names of the associated
56 functions to get and set those attribute values are implementation-dependent.
57 .SH RETURN VALUES
58 .sp
59 .LP
60 If successful, the \fBpthread_condattr_setpshared()\fR function returns
61 \fB0\fR. Otherwise, an error number is returned to indicate the error.
62 .sp
63 .LP
64 If successful, the \fBpthread_condattr_getpshared()\fR function returns
65 \fB0\fR and stores the value of the \fIprocess-shared\fR attribute of
66 \fIattr\fR into the object referenced by the \fIpshared\fR parameter.
67 Otherwise, an error number is returned to indicate the error.
68 .SH ERRORS
69 .sp
70 .LP
71 The \fBpthread_condattr_getpshared()\fR and \fBpthread_condattr_setpshared()\fR
72 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_condattr_setpshared()\fR function will 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 attribute is outside the range of legal values
92 for that attribute.
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_condattr_init\fR(3C), \fBpthread_create\fR(3C),
117 \fBpthread_mutex_init\fR(3C), \fBpthread_cond_init\fR(3C), \fBattributes\fR(5),
118 \fBstandards\fR(5)