1PTHREAD_RWLOCKATTR_GETPSHAREPDO(S3IPX)Programmer'sPMTaHnRuEaAlD_RWLOCKATTR_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
11

NAME

13       pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared — get  and
14       set  the  process-shared  attribute  of  the read-write lock attributes
15       object
16

SYNOPSIS

18       #include <pthread.h>
19
20       int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t
21           *restrict attr, int *restrict pshared);
22       int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr,
23           int pshared);
24

DESCRIPTION

26       The pthread_rwlockattr_getpshared() function shall obtain the value  of
27       the  process-shared  attribute  from  the initialized attributes object
28       referenced by attr.  The pthread_rwlockattr_setpshared() function shall
29       set  the  process-shared  attribute in an initialized attributes object
30       referenced by attr.
31
32       The process-shared attribute shall be set to PTHREAD_PROCESS_SHARED  to
33       permit  a  read-write  lock  to be operated upon by any thread that has
34       access to the memory where the read-write lock is  allocated,  even  if
35       the  read-write  lock is allocated in memory that is shared by multiple
36       processes. If the process-shared attribute is  PTHREAD_PROCESS_PRIVATE,
37       the  read-write  lock  shall  only  be operated upon by threads created
38       within the same process as the thread that initialized  the  read-write
39       lock;  if  threads  of differing processes attempt to operate on such a
40       read-write lock, the behavior is undefined. The default  value  of  the
41       process-shared attribute shall be PTHREAD_PROCESS_PRIVATE.
42
43       Additional attributes, their default values, and the names of the asso‐
44       ciated functions to get and set those attribute values are  implementa‐
45       tion-defined.
46
47       The  behavior  is undefined if the value specified by the attr argument
48       to pthread_rwlockattr_getpshared()  or  pthread_rwlockattr_setpshared()
49       does not refer to an initialized read-write lock attributes object.
50

RETURN VALUE

52       Upon  successful  completion, the pthread_rwlockattr_getpshared() func‐
53       tion shall return zero  and  store  the  value  of  the  process-shared
54       attribute  of attr into the object referenced by the pshared parameter.
55       Otherwise, an error number shall be returned to indicate the error.
56
57       If  successful,  the  pthread_rwlockattr_setpshared()  function   shall
58       return  zero;  otherwise, an error number shall be returned to indicate
59       the error.
60

ERRORS

62       The pthread_rwlockattr_setpshared() function may fail if:
63
64       EINVAL The new value specified for the attribute is outside  the  range
65              of legal values for that attribute.
66
67       These functions shall not return an error code of [EINTR].
68
69       The following sections are informative.
70

EXAMPLES

72       None.
73

APPLICATION USAGE

75       None.
76

RATIONALE

78       None.
79

FUTURE DIRECTIONS

81       None.
82

SEE ALSO

84       pthread_rwlock_destroy(), pthread_rwlockattr_destroy()
85
86       The Base Definitions volume of POSIX.1‐2008, <pthread.h>
87
89       Portions  of  this text are reprinted and reproduced in electronic form
90       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
91       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
92       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
93       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
94       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
95       event of any discrepancy between this version and the original IEEE and
96       The Open Group Standard, the original IEEE and The Open Group  Standard
97       is  the  referee document. The original Standard can be obtained online
98       at http://www.unix.org/online.html .
99
100       Any typographical or formatting errors that appear  in  this  page  are
101       most likely to have been introduced during the conversion of the source
102       files to man page format. To report such errors,  see  https://www.ker
103       nel.org/doc/man-pages/reporting_bugs.html .
104
105
106
107IEEE/The Open Group                  2013    PTHREAD_RWLOCKATTR_GETPSHARED(3P)
Impressum