1PTHREAD_RWLOCKATTR_GETPSHAREPDO(S3IPX)Programmer'sPMTaHnRuEaAlD_RWLOCKATTR_GETPSHARED(3P)
2
3
4
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
12 pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared — get and
13 set the process-shared attribute of the read-write lock attributes
14 object
15
17 #include <pthread.h>
18
19 int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t
20 *restrict attr, int *restrict pshared);
21 int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr,
22 int pshared);
23
25 The pthread_rwlockattr_getpshared() function shall obtain the value of
26 the process-shared attribute from the initialized attributes object
27 referenced by attr. The pthread_rwlockattr_setpshared() function shall
28 set the process-shared attribute in an initialized attributes object
29 referenced by attr.
30
31 The process-shared attribute shall be set to PTHREAD_PROCESS_SHARED to
32 permit a read-write lock to be operated upon by any thread that has
33 access to the memory where the read-write lock is allocated, even if
34 the read-write lock 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 process-shared attribute shall be PTHREAD_PROCESS_PRIVATE.
38
39 Additional attributes, their default values, and the names of the asso‐
40 ciated functions to get and set those attribute values are implementa‐
41 tion-defined.
42
43 The behavior is undefined if the value specified by the attr argument
44 to pthread_rwlockattr_getpshared() or pthread_rwlockattr_setpshared()
45 does not refer to an initialized read-write lock attributes object.
46
48 Upon successful completion, the pthread_rwlockattr_getpshared() func‐
49 tion shall return zero and store the value of the process-shared
50 attribute of attr into the object referenced by the pshared parameter.
51 Otherwise, an error number shall be returned to indicate the error.
52
53 If successful, the pthread_rwlockattr_setpshared() function shall
54 return zero; otherwise, an error number shall be returned to indicate
55 the error.
56
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 These functions shall not return an error code of [EINTR].
64
65 The following sections are informative.
66
68 None.
69
71 None.
72
74 None.
75
77 None.
78
80 pthread_rwlock_destroy(), pthread_rwlockattr_destroy()
81
82 The Base Definitions volume of POSIX.1‐2017, <pthread.h>
83
85 Portions of this text are reprinted and reproduced in electronic form
86 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
87 table Operating System Interface (POSIX), The Open Group Base Specifi‐
88 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
89 Electrical and Electronics Engineers, Inc and The Open Group. In the
90 event of any discrepancy between this version and the original IEEE and
91 The Open Group Standard, the original IEEE and The Open Group Standard
92 is the referee document. The original Standard can be obtained online
93 at http://www.opengroup.org/unix/online.html .
94
95 Any typographical or formatting errors that appear in this page are
96 most likely to have been introduced during the conversion of the source
97 files to man page format. To report such errors, see https://www.ker‐
98 nel.org/doc/man-pages/reporting_bugs.html .
99
100
101
102IEEE/The Open Group 2017 PTHREAD_RWLOCKATTR_GETPSHARED(3P)