1PTHREAD_RWLOCKATTR_GETPSHAREPDO(SPI)X Programmer's MPaTnHuRaElAD_RWLOCKATTR_GETPSHARED(P)
2
3
4
6 pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared - get and
7 set the process-shared attribute of the read-write lock attributes
8 object
9
11 #include <pthread.h>
12
13 int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *
14 restrict attr, int *restrict pshared);
15 int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr,
16 int pshared);
17
18
20 The pthread_rwlockattr_getpshared() function shall obtain the value of
21 the process-shared attribute from the initialized attributes object
22 referenced by attr. The pthread_rwlockattr_setpshared() function shall
23 set the process-shared attribute in an initialized attributes object
24 referenced by attr.
25
26 The process-shared attribute shall be set to PTHREAD_PROCESS_SHARED to
27 permit a read-write lock to be operated upon by any thread that has
28 access to the memory where the read-write lock is allocated, even if
29 the read-write lock is allocated in memory that is shared by multiple
30 processes. If the process-shared attribute is PTHREAD_PROCESS_PRIVATE,
31 the read-write lock shall only be operated upon by threads created
32 within the same process as the thread that initialized the read-write
33 lock; if threads of differing processes attempt to operate on such a
34 read-write lock, the behavior is undefined. The default value of the
35 process-shared attribute shall be PTHREAD_PROCESS_PRIVATE.
36
37 Additional attributes, their default values, and the names of the asso‐
38 ciated functions to get and set those attribute values are implementa‐
39 tion-defined.
40
42 Upon successful completion, the pthread_rwlockattr_getpshared() func‐
43 tion shall return zero and store the value of the process-shared
44 attribute of attr into the object referenced by the pshared parameter.
45 Otherwise, an error number shall be returned to indicate the error.
46
47 If successful, the pthread_rwlockattr_setpshared() function shall
48 return zero; otherwise, an error number shall be returned to indicate
49 the error.
50
52 The pthread_rwlockattr_getpshared() and pthread_rwlockattr_setpshared()
53 functions may fail if:
54
55 EINVAL The value specified by attr is invalid.
56
57
58 The pthread_rwlockattr_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
64 These functions shall not return an error code of [EINTR].
65
66 The following sections are informative.
67
69 None.
70
72 None.
73
75 None.
76
78 None.
79
81 pthread_rwlock_destroy() , pthread_rwlockattr_destroy() ,
82 pthread_rwlockattr_init() , the Base Definitions volume of
83 IEEE Std 1003.1-2001, <pthread.h>
84
86 Portions of this text are reprinted and reproduced in electronic form
87 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
88 -- Portable Operating System Interface (POSIX), The Open Group Base
89 Specifications Issue 6, Copyright (C) 2001-2003 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
97
98IEEE/The Open Group 2003 PTHREAD_RWLOCKATTR_GETPSHARED(P)