]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3p/pthread_barrierattr_getpshared.3p
Import of man-pages 1.70
[thirdparty/man-pages.git] / man3p / pthread_barrierattr_getpshared.3p
1 .\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
2 .TH "PTHREAD_BARRIERATTR_GETPSHARED" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
3 .\" pthread_barrierattr_getpshared
4 .SH NAME
5 pthread_barrierattr_getpshared, pthread_barrierattr_setpshared \- get
6 and set the process\-shared attribute of the
7 barrier attributes object (\fBADVANCED REALTIME THREADS\fP)
8 .SH SYNOPSIS
9 .LP
10 \fB#include <pthread.h>
11 .br
12 .sp
13 \fP
14 .LP
15 \fBint pthread_barrierattr_getpshared(const pthread_barrierattr_t
16 *
17 .br
18 \ \ \ \ \ \ restrict\fP \fIattr\fP\fB, int *restrict\fP \fIpshared\fP\fB);
19 .br
20 int pthread_barrierattr_setpshared(pthread_barrierattr_t *\fP\fIattr\fP\fB,
21 .br
22 \ \ \ \ \ \ int\fP \fIpshared\fP\fB); \fP
23 \fB
24 .br
25 \fP
26 .SH DESCRIPTION
27 .LP
28 The \fIpthread_barrierattr_getpshared\fP() function shall obtain the
29 value of the \fIprocess-shared\fP attribute from the
30 attributes object referenced by \fIattr\fP. The \fIpthread_barrierattr_setpshared\fP()
31 function shall set the
32 \fIprocess-shared\fP attribute in an initialized attributes object
33 referenced by \fIattr\fP.
34 .LP
35 The \fIprocess-shared\fP attribute is set to PTHREAD_PROCESS_SHARED
36 to permit a barrier to be operated upon by any thread that
37 has access to the memory where the barrier is allocated. If the \fIprocess-shared\fP
38 attribute is PTHREAD_PROCESS_PRIVATE, the
39 barrier shall only be operated upon by threads created within the
40 same process as the thread that initialized the barrier; if
41 threads of different processes attempt to operate on such a barrier,
42 the behavior is undefined. The default value of the attribute
43 shall be PTHREAD_PROCESS_PRIVATE. Both constants PTHREAD_PROCESS_SHARED
44 and PTHREAD_PROCESS_PRIVATE are defined in \fI<pthread.h>\fP.
45 .LP
46 Additional attributes, their default values, and the names of the
47 associated functions to get and set those attribute values are
48 implementation-defined.
49 .SH RETURN VALUE
50 .LP
51 If successful, the \fIpthread_barrierattr_getpshared\fP() function
52 shall return zero and store the value of the
53 \fIprocess-shared\fP attribute of \fIattr\fP into the object referenced
54 by the \fIpshared\fP parameter. Otherwise, an error
55 number shall be returned to indicate the error.
56 .LP
57 If successful, the \fIpthread_barrierattr_setpshared\fP() function
58 shall return zero; otherwise, an error number shall be
59 returned to indicate the error.
60 .SH ERRORS
61 .LP
62 These functions may fail if:
63 .TP 7
64 .B EINVAL
65 The value specified by \fIattr\fP is invalid.
66 .sp
67 .LP
68 The \fIpthread_barrierattr_setpshared\fP() function may fail if:
69 .TP 7
70 .B EINVAL
71 The new value specified for the \fIprocess-shared\fP attribute is
72 not one of the legal values PTHREAD_PROCESS_SHARED or
73 PTHREAD_PROCESS_PRIVATE.
74 .sp
75 .LP
76 These functions shall not return an error code of [EINTR].
77 .LP
78 \fIThe following sections are informative.\fP
79 .SH EXAMPLES
80 .LP
81 None.
82 .SH APPLICATION USAGE
83 .LP
84 The \fIpthread_barrierattr_getpshared\fP() and \fIpthread_barrierattr_setpshared\fP()
85 functions are part of the Barriers
86 option and need not be provided on all implementations.
87 .SH RATIONALE
88 .LP
89 None.
90 .SH FUTURE DIRECTIONS
91 .LP
92 None.
93 .SH SEE ALSO
94 .LP
95 \fIpthread_barrier_destroy\fP() , \fIpthread_barrierattr_destroy\fP()
96 , \fIpthread_barrierattr_init\fP() , the Base Definitions volume of
97 IEEE\ Std\ 1003.1-2001, \fI<pthread.h>\fP
98 .SH COPYRIGHT
99 Portions of this text are reprinted and reproduced in electronic form
100 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
101 -- Portable Operating System Interface (POSIX), The Open Group Base
102 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
103 Electrical and Electronics Engineers, Inc and The Open Group. In the
104 event of any discrepancy between this version and the original IEEE and
105 The Open Group Standard, the original IEEE and The Open Group Standard
106 is the referee document. The original Standard can be obtained online at
107 http://www.opengroup.org/unix/online.html .