1PTHREAD_CONDATTR_GETPSHARED(PPO)SIX Programmer's ManPuTaHlREAD_CONDATTR_GETPSHARED(P)
2
3
4

NAME

6       pthread_condattr_getpshared,  pthread_condattr_setpshared - get and set
7       the process-shared condition variable attributes
8

SYNOPSIS

10       #include <pthread.h>
11
12       int  pthread_condattr_getpshared(const   pthread_condattr_t   *restrict
13       attr,
14              int *restrict pshared);
15       int pthread_condattr_setpshared(pthread_condattr_t *attr,
16              int pshared);
17
18

DESCRIPTION

20       The  pthread_condattr_getpshared()  function  shall obtain the value of
21       the process-shared attribute from the attributes object  referenced  by
22       attr. The pthread_condattr_setpshared() function shall set the process-
23       shared attribute in an  initialized  attributes  object  referenced  by
24       attr.
25
26       The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit
27       a condition variable to be operated upon by any thread that has  access
28       to  the  memory  where the condition variable is allocated, even if the
29       condition variable is allocated in memory that is  shared  by  multiple
30       processes.  If the process-shared attribute is PTHREAD_PROCESS_PRIVATE,
31       the condition variable shall only be operated upon by  threads  created
32       within  the  same  process as the thread that initialized the condition
33       variable; if threads of differing processes attempt to operate on  such
34       a  condition  variable, the behavior is undefined. The default value of
35       the attribute is PTHREAD_PROCESS_PRIVATE.
36

RETURN VALUE

38       If successful, the pthread_condattr_setpshared() function shall  return
39       zero;  otherwise,  an  error  number  shall be returned to indicate the
40       error.
41
42       If successful, the pthread_condattr_getpshared() function shall  return
43       zero  and  store the value of the process-shared attribute of attr into
44       the object referenced by the pshared  parameter.  Otherwise,  an  error
45       number shall be returned to indicate the error.
46

ERRORS

48       The   pthread_condattr_getpshared()  and  pthread_condattr_setpshared()
49       functions may fail if:
50
51       EINVAL The value specified by attr is invalid.
52
53
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
60       These functions shall not return an error code of [EINTR].
61
62       The following sections are informative.
63

EXAMPLES

65       None.
66

APPLICATION USAGE

68       None.
69

RATIONALE

71       None.
72

FUTURE DIRECTIONS

74       None.
75

SEE ALSO

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