~ubuntu-branches/ubuntu/precise/manpages-posix/precise

1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
1
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
2 by Francesco Paolo Lovergine
* Alligned to linux main manpages edition.
2
.TH "PTHREAD_CONDATTR_GETPSHARED" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
3
.\" pthread_condattr_getpshared 
4
.SH NAME
5
pthread_condattr_getpshared, pthread_condattr_setpshared \- get and
6
set the process\-shared condition variable
7
attributes
8
.SH SYNOPSIS
9
.LP
10
\fB#include <pthread.h>
11
.br
12
.sp
13
int pthread_condattr_getpshared(const pthread_condattr_t *restrict\fP
14
\fIattr\fP\fB,
15
.br
16
\ \ \ \ \ \  int *restrict\fP \fIpshared\fP\fB);
17
.br
18
int pthread_condattr_setpshared(pthread_condattr_t *\fP\fIattr\fP\fB,
19
.br
20
\ \ \ \ \ \  int\fP \fIpshared\fP\fB); \fP
21
\fB
22
.br
23
\fP
24
.SH DESCRIPTION
25
.LP
26
The \fIpthread_condattr_getpshared\fP() function shall obtain the
27
value of the \fIprocess-shared\fP attribute from the
28
attributes object referenced by \fIattr\fP. The \fIpthread_condattr_setpshared\fP()
29
function shall set the \fIprocess-shared\fP
30
attribute in an initialized attributes object referenced by \fIattr\fP.
31
.LP
32
The \fIprocess-shared\fP attribute is set to PTHREAD_PROCESS_SHARED
33
to permit a condition variable to be operated upon by any
34
thread that has access to the memory where the condition variable
35
is allocated, even if the condition variable is allocated in
36
memory that is shared by multiple processes. If the \fIprocess-shared\fP
37
attribute is PTHREAD_PROCESS_PRIVATE, the condition
38
variable shall only be operated upon by threads created within the
39
same process as the thread that initialized the condition
40
variable; if threads of differing processes attempt to operate on
41
such a condition variable, the behavior is undefined. The default
42
value of the attribute is PTHREAD_PROCESS_PRIVATE.
43
.SH RETURN VALUE
44
.LP
45
If successful, the \fIpthread_condattr_setpshared\fP() function shall
46
return zero; otherwise, an error number shall be returned
47
to indicate the error.
48
.LP
49
If successful, the \fIpthread_condattr_getpshared\fP() function shall
50
return zero and store the value of the
51
\fIprocess-shared\fP attribute of \fIattr\fP into the object referenced
52
by the \fIpshared\fP parameter. Otherwise, an error
53
number shall be returned to indicate the error.
54
.SH ERRORS
55
.LP
56
The \fIpthread_condattr_getpshared\fP() and \fIpthread_condattr_setpshared\fP()
57
functions may fail if:
58
.TP 7
59
.B EINVAL
60
The value specified by \fIattr\fP is invalid.
61
.sp
62
.LP
63
The \fIpthread_condattr_setpshared\fP() function may fail if:
64
.TP 7
65
.B EINVAL
66
The new value specified for the attribute is outside the range of
67
legal values for that attribute.
68
.sp
69
.LP
70
These functions shall not return an error code of [EINTR].
71
.LP
72
\fIThe following sections are informative.\fP
73
.SH EXAMPLES
74
.LP
75
None.
76
.SH APPLICATION USAGE
77
.LP
78
None.
79
.SH RATIONALE
80
.LP
81
None.
82
.SH FUTURE DIRECTIONS
83
.LP
84
None.
85
.SH SEE ALSO
86
.LP
87
\fIpthread_create\fP() , \fIpthread_cond_destroy\fP() , \fIpthread_condattr_destroy\fP()
88
, \fIpthread_mutex_destroy\fP() , the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
89
\fI<pthread.h>\fP
90
.SH COPYRIGHT
91
Portions of this text are reprinted and reproduced in electronic form
92
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
93
-- Portable Operating System Interface (POSIX), The Open Group Base
94
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
95
Electrical and Electronics Engineers, Inc and The Open Group. In the
96
event of any discrepancy between this version and the original IEEE and
97
The Open Group Standard, the original IEEE and The Open Group Standard
98
is the referee document. The original Standard can be obtained online at
99
http://www.opengroup.org/unix/online.html .