1PTHREAD_CONDATTR_GETPSHARED(P3OPS)IX Programmer's MaPnTuHaRlEAD_CONDATTR_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
11

NAME

13       pthread_condattr_getpshared, pthread_condattr_setpshared — get and  set
14       the process-shared condition variable attributes
15

SYNOPSIS

17       #include <pthread.h>
18
19       int pthread_condattr_getpshared(const pthread_condattr_t *restrict attr,
20           int *restrict pshared);
21       int pthread_condattr_setpshared(pthread_condattr_t *attr,
22           int pshared);
23

DESCRIPTION

25       The  pthread_condattr_getpshared()  function  shall obtain the value of
26       the process-shared attribute from the attributes object  referenced  by
27       attr.
28
29       The pthread_condattr_setpshared() function shall set the process-shared
30       attribute in an initialized attributes object referenced by attr.
31
32       The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit
33       a  condition variable to be operated upon by any thread that has access
34       to the memory where the condition variable is allocated,  even  if  the
35       condition  variable  is  allocated in memory that is shared by multiple
36       processes. If the process-shared attribute is  PTHREAD_PROCESS_PRIVATE,
37       the  condition  variable shall only be operated upon by threads created
38       within the same process as the thread that  initialized  the  condition
39       variable;  if threads of differing processes attempt to operate on such
40       a condition variable, the behavior is undefined. The default  value  of
41       the attribute is PTHREAD_PROCESS_PRIVATE.
42
43       The  behavior  is undefined if the value specified by the attr argument
44       to pthread_condattr_getpshared() or pthread_condattr_setpshared()  does
45       not refer to an initialized condition variable attributes object.
46

RETURN VALUE

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

ERRORS

58       The pthread_condattr_setpshared() function may fail if:
59
60       EINVAL The new value specified for the attribute is outside  the  range
61              of legal values for that attribute.
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       None.
72

RATIONALE

74       If an implementation detects that the value specified by the attr argu‐
75       ment to pthread_condattr_getpshared() or  pthread_condattr_setpshared()
76       does  not refer to an initialized condition variable attributes object,
77       it is recommended that the function should fail and report an  [EINVAL]
78       error.
79

FUTURE DIRECTIONS

81       None.
82

SEE ALSO

84       pthread_create(), pthread_cond_destroy(), pthread_condattr_destroy(),
85       pthread_mutex_destroy()
86
87       The Base Definitions volume of POSIX.1‐2008, <pthread.h>
88
90       Portions of this text are reprinted and reproduced in  electronic  form
91       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
92       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
93       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
94       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
95       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) 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.unix.org/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                  2013      PTHREAD_CONDATTR_GETPSHARED(3P)
Impressum