nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man3c / pthread_condattr_getpshared.3c
blobef9c09d2310f126df6eecb821a2d971a412eb57e
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_CONDATTR_GETPSHARED 3C "Mar 23, 2005"
48 .SH NAME
49 pthread_condattr_getpshared, pthread_condattr_setpshared \- get or set
50 process-shared condition variable attributes
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_condattr_getpshared\fR(
58      \fBconst pthread_condattr_t *restrict\fR \fIattr\fR,
59      \fBint *restrict\fR \fIpshared\fR);
60 .fi
62 .LP
63 .nf
64 \fBint\fR \fBpthread_condattr_setpshared\fR(\fBpthread_condattr_t *\fR\fIattr\fR,
65      \fBint\fR \fIpshared\fR);
66 .fi
68 .SH DESCRIPTION
69 .sp
70 .LP
71 The \fBpthread_condattr_getpshared()\fR function obtains the value of the
72 \fIprocess-shared\fR attribute from the attributes object referenced by
73 \fIattr\fR. The \fBpthread_condattr_setpshared()\fR function is used to set the
74 \fIprocess-shared\fR attribute in an initialized attributes object referenced
75 by \fIattr\fR.
76 .sp
77 .LP
78 The \fIprocess-shared\fR attribute is set to  \fBPTHREAD_PROCESS_SHARED\fR to
79 permit a condition variable to be operated upon by any thread that has access
80 to the memory where the condition variable is allocated, even if the condition
81 variable is allocated in memory that is shared by multiple processes. If the
82 \fIprocess-shared\fR attribute is  \fBPTHREAD_PROCESS_PRIVATE,\fR the condition
83 variable will only be operated upon by threads created within the same process
84 as the thread that initialized the condition variable; if threads of differing
85 processes attempt to operate on such a condition variable, the behavior is
86 undefined.  The default value of the attribute is
87 \fBPTHREAD_PROCESS_PRIVATE.\fR
88 .sp
89 .LP
90 Additional attributes, their default values, and the names of the associated
91 functions to get and set those attribute values are implementation-dependent.
92 .SH RETURN VALUES
93 .sp
94 .LP
95 If successful, the \fBpthread_condattr_setpshared()\fR function returns
96 \fB0\fR. Otherwise, an error number is returned to indicate the error.
97 .sp
98 .LP
99 If successful, the \fBpthread_condattr_getpshared()\fR function returns
100 \fB0\fR and stores the value of the \fIprocess-shared\fR attribute of
101 \fIattr\fR into the object referenced by the \fIpshared\fR parameter.
102 Otherwise, an error number is returned to indicate the error.
103 .SH ERRORS
106 The \fBpthread_condattr_getpshared()\fR and \fBpthread_condattr_setpshared()\fR
107 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_condattr_setpshared()\fR function will fail if:
121 .ne 2
123 \fB\fBEINVAL\fR\fR
125 .RS 10n
126 The new value specified for the attribute is outside the range of legal values
127 for that attribute.
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_condattr_init\fR(3C), \fBpthread_create\fR(3C),
152 \fBpthread_mutex_init\fR(3C), \fBpthread_cond_init\fR(3C), \fBattributes\fR(5),
153 \fBstandards\fR(5)