1PTHREAD_BARRIERATTR_GETPSHARPEODS(I3XP)Programmer'sPTMHaRnEuAaDl_BARRIERATTR_GETPSHARED(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       pthread_barrierattr_getpshared,  pthread_barrierattr_setpshared  —  get
13       and set the process-shared attribute of the barrier attributes object
14

SYNOPSIS

16       #include <pthread.h>
17
18       int pthread_barrierattr_getpshared(const pthread_barrierattr_t
19           *restrict attr, int *restrict pshared);
20       int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr,
21           int pshared);
22

DESCRIPTION

24       The pthread_barrierattr_getpshared() function shall obtain the value of
25       the process-shared attribute from the attributes object  referenced  by
26       attr.   The  pthread_barrierattr_setpshared()  function  shall  set the
27       process-shared attribute in an initialized attributes object referenced
28       by attr.
29
30       The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit
31       a barrier to be operated upon by any thread that has access to the mem‐
32       ory  where the barrier is allocated. See Section 2.9.9, Synchronization
33       Object Copies and Alternative Mappings for  further  requirements.  The
34       default  value  of the attribute shall be PTHREAD_PROCESS_PRIVATE. Both
35       constants  PTHREAD_PROCESS_SHARED   and   PTHREAD_PROCESS_PRIVATE   are
36       defined in <pthread.h>.
37
38       Additional attributes, their default values, and the names of the asso‐
39       ciated functions to get and set those attribute values are  implementa‐
40       tion-defined.
41
42       The  behavior  is undefined if the value specified by the attr argument
43       to pthread_barrierattr_getpshared() or pthread_barrierattr_setpshared()
44       does not refer to an initialized barrier attributes object.
45

RETURN VALUE

47       If  successful,  the  pthread_barrierattr_getpshared()  function  shall
48       return zero and store the value of the process-shared attribute of attr
49       into  the  object  referenced  by  the pshared parameter. Otherwise, an
50       error number shall be returned to indicate the error.
51
52       If  successful,  the  pthread_barrierattr_setpshared()  function  shall
53       return  zero;  otherwise, an error number shall be returned to indicate
54       the error.
55

ERRORS

57       The pthread_barrierattr_setpshared() function may fail if:
58
59       EINVAL The new value specified for the process-shared attribute is  not
60              one    of    the    legal   values   PTHREAD_PROCESS_SHARED   or
61              PTHREAD_PROCESS_PRIVATE.
62
63       These functions shall not return an error code of [EINTR].
64
65       The following sections are informative.
66

EXAMPLES

68       None.
69

APPLICATION USAGE

71       The  pthread_barrierattr_getpshared()   and   pthread_barrierattr_setp‐
72       shared()  functions  are part of the Thread Process-Shared Synchroniza‐
73       tion option and need not be provided on all implementations.
74

RATIONALE

76       If an implementation detects that the value specified by the attr argu‐
77       ment  to  pthread_barrierattr_getpshared() or pthread_barrierattr_setp‐
78       shared() does not refer to an initialized barrier attributes object, it
79       is  recommended  that  the  function should fail and report an [EINVAL]
80       error.
81

FUTURE DIRECTIONS

83       None.
84

SEE ALSO

86       pthread_barrier_destroy(), pthread_barrierattr_destroy()
87
88       The Base Definitions volume of POSIX.1‐2017, <pthread.h>
89
91       Portions of this text are reprinted and reproduced in  electronic  form
92       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
93       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
94       cations  Issue  7, 2018 Edition, Copyright (C) 2018 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
99       at http://www.opengroup.org/unix/online.html .
100
101       Any typographical or formatting errors that appear  in  this  page  are
102       most likely to have been introduced during the conversion of the source
103       files to man page format. To report such errors,  see  https://www.ker
104       nel.org/doc/man-pages/reporting_bugs.html .
105
106
107
108IEEE/The Open Group                  2017   PTHREAD_BARRIERATTR_GETPSHARED(3P)
Impressum