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

NAME

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

SYNOPSIS

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

DESCRIPTION

24       The  pthread_condattr_getpshared()  function  shall obtain the value of
25       the process-shared attribute from the attributes object  referenced  by
26       attr.
27
28       The pthread_condattr_setpshared() function shall set the process-shared
29       attribute in an initialized attributes object referenced by attr.
30
31       The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit
32       a  condition variable to be operated upon by any thread that has access
33       to the memory where the condition variable is allocated,  even  if  the
34       condition  variable  is  allocated in memory that is shared by multiple
35       processes. See Section 2.9.9, Synchronization Object Copies and  Alter‐
36       native  Mappings  for  further  requirements.  The default value of the
37       attribute is PTHREAD_PROCESS_PRIVATE.
38
39       The behavior is undefined if the value specified by the  attr  argument
40       to  pthread_condattr_getpshared() or pthread_condattr_setpshared() does
41       not refer to an initialized condition variable attributes object.
42

RETURN VALUE

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

ERRORS

54       The pthread_condattr_setpshared() function may fail if:
55
56       EINVAL The  new  value specified for the attribute is outside the range
57              of legal values for that attribute.
58
59       These functions shall not return an error code of [EINTR].
60
61       The following sections are informative.
62

EXAMPLES

64       None.
65

APPLICATION USAGE

67       None.
68

RATIONALE

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

FUTURE DIRECTIONS

77       None.
78

SEE ALSO

80       pthread_create(), pthread_cond_destroy(), pthread_condattr_destroy(),
81       pthread_mutex_destroy()
82
83       The Base Definitions volume of POSIX.1‐2017, <pthread.h>
84
86       Portions  of  this text are reprinted and reproduced in electronic form
87       from IEEE Std 1003.1-2017, Standard for Information Technology --  Por‐
88       table  Operating System Interface (POSIX), The Open Group Base Specifi‐
89       cations Issue 7, 2018 Edition, Copyright (C) 2018 by the  Institute  of
90       Electrical  and  Electronics Engineers, Inc and The Open Group.  In the
91       event of any discrepancy between this version and the original IEEE and
92       The  Open Group Standard, the original IEEE and The Open Group Standard
93       is the referee document. The original Standard can be  obtained  online
94       at http://www.opengroup.org/unix/online.html .
95
96       Any  typographical  or  formatting  errors that appear in this page are
97       most likely to have been introduced during the conversion of the source
98       files  to  man page format. To report such errors, see https://www.ker
99       nel.org/doc/man-pages/reporting_bugs.html .
100
101
102
103IEEE/The Open Group                  2017      PTHREAD_CONDATTR_GETPSHARED(3P)
Impressum