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
19       attr,
20              int *restrict pshared);
21       int pthread_condattr_setpshared(pthread_condattr_t *attr,
22              int pshared);
23
24

DESCRIPTION

26       The pthread_condattr_getpshared() function shall obtain  the  value  of
27       the  process-shared  attribute from the attributes object referenced by
28       attr. The pthread_condattr_setpshared() function shall set the process-
29       shared  attribute  in  an  initialized  attributes object referenced by
30       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

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_getpshared()  and   pthread_condattr_setpshared()
55       functions may fail if:
56
57       EINVAL The value specified by attr is invalid.
58
59
60       The pthread_condattr_setpshared() function may fail if:
61
62       EINVAL The  new  value specified for the attribute is outside the range
63              of legal values for that attribute.
64
65
66       These functions shall not return an error code of [EINTR].
67
68       The following sections are informative.
69

EXAMPLES

71       None.
72

APPLICATION USAGE

74       None.
75

RATIONALE

77       None.
78

FUTURE DIRECTIONS

80       None.
81

SEE ALSO

83       pthread_create(),  pthread_cond_destroy(),  pthread_condattr_destroy(),
84       pthread_mutex_destroy(),     the    Base    Definitions    volume    of
85       IEEE Std 1003.1-2001, <pthread.h>
86
88       Portions of this text are reprinted and reproduced in  electronic  form
89       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
90       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
91       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
92       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
93       event of any discrepancy between this version and the original IEEE and
94       The Open Group Standard, the original IEEE and The Open Group  Standard
95       is  the  referee document. The original Standard can be obtained online
96       at http://www.opengroup.org/unix/online.html .
97
98
99
100IEEE/The Open Group                  2003      PTHREAD_CONDATTR_GETPSHARED(3P)
Impressum