logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

pthread_mutexattr_getpshared.3p (4007B)


  1. '\" et
  2. .TH PTHREAD_MUTEXATTR_GETPSHARED "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. pthread_mutexattr_getpshared,
  12. pthread_mutexattr_setpshared
  13. \(em get and set the process-shared attribute
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <pthread.h>
  18. .P
  19. int pthread_mutexattr_getpshared(const pthread_mutexattr_t
  20. *restrict \fIattr\fP, int *restrict \fIpshared\fP);
  21. int pthread_mutexattr_setpshared(pthread_mutexattr_t *\fIattr\fP,
  22. int \fIpshared\fP);
  23. .fi
  24. .SH DESCRIPTION
  25. The
  26. \fIpthread_mutexattr_getpshared\fR()
  27. function shall obtain the value of the
  28. .IR process-shared
  29. attribute from the attributes object referenced by
  30. .IR attr .
  31. .P
  32. The
  33. \fIpthread_mutexattr_setpshared\fR()
  34. function shall set the
  35. .IR process-shared
  36. attribute in an initialized attributes object referenced by
  37. .IR attr .
  38. .P
  39. The
  40. .IR process-shared
  41. attribute is set to PTHREAD_PROCESS_SHARED to permit a mutex
  42. to be operated upon by any thread that has access to the memory where
  43. the mutex is allocated, even if the mutex is allocated in memory that
  44. is shared by multiple processes. See
  45. .IR "Section 2.9.9" ", " "Synchronization Object Copies and Alternative Mappings"
  46. for further requirements. The default value of the attribute
  47. shall be PTHREAD_PROCESS_PRIVATE.
  48. .P
  49. The behavior is undefined if the value specified by the
  50. .IR attr
  51. argument to
  52. \fIpthread_mutexattr_getpshared\fR()
  53. or
  54. \fIpthread_mutexattr_setpshared\fR()
  55. does not refer to an initialized mutex attributes object.
  56. .SH "RETURN VALUE"
  57. Upon successful completion,
  58. \fIpthread_mutexattr_setpshared\fR()
  59. shall return zero; otherwise, an error number shall be returned to
  60. indicate the error.
  61. .P
  62. Upon successful completion,
  63. \fIpthread_mutexattr_getpshared\fR()
  64. shall return zero and store the value of the
  65. .IR process-shared
  66. attribute of
  67. .IR attr
  68. into the object referenced by the
  69. .IR pshared
  70. parameter. Otherwise, an error number shall be returned to indicate
  71. the error.
  72. .SH ERRORS
  73. The
  74. \fIpthread_mutexattr_setpshared\fR()
  75. function may fail if:
  76. .TP
  77. .BR EINVAL
  78. The new value specified for the attribute is outside the range of legal
  79. values for that attribute.
  80. .P
  81. These functions shall not return an error code of
  82. .BR [EINTR] .
  83. .LP
  84. .IR "The following sections are informative."
  85. .SH EXAMPLES
  86. None.
  87. .SH "APPLICATION USAGE"
  88. None.
  89. .SH RATIONALE
  90. If an implementation detects that the value specified by the
  91. .IR attr
  92. argument to
  93. \fIpthread_mutexattr_getpshared\fR()
  94. or
  95. \fIpthread_mutexattr_setpshared\fR()
  96. does not refer to an initialized mutex attributes object, it is
  97. recommended that the function should fail and report an
  98. .BR [EINVAL]
  99. error.
  100. .SH "FUTURE DIRECTIONS"
  101. None.
  102. .SH "SEE ALSO"
  103. .ad l
  104. .IR "\fIpthread_cond_destroy\fR\^(\|)",
  105. .IR "\fIpthread_create\fR\^(\|)",
  106. .IR "\fIpthread_mutex_destroy\fR\^(\|)",
  107. .IR "\fIpthread_mutexattr_destroy\fR\^(\|)"
  108. .ad b
  109. .P
  110. The Base Definitions volume of POSIX.1\(hy2017,
  111. .IR "\fB<pthread.h>\fP"
  112. .\"
  113. .SH COPYRIGHT
  114. Portions of this text are reprinted and reproduced in electronic form
  115. from IEEE Std 1003.1-2017, Standard for Information Technology
  116. -- Portable Operating System Interface (POSIX), The Open Group Base
  117. Specifications Issue 7, 2018 Edition,
  118. Copyright (C) 2018 by the Institute of
  119. Electrical and Electronics Engineers, Inc and The Open Group.
  120. In the event of any discrepancy between this version and the original IEEE and
  121. The Open Group Standard, the original IEEE and The Open Group Standard
  122. is the referee document. The original Standard can be obtained online at
  123. http://www.opengroup.org/unix/online.html .
  124. .PP
  125. Any typographical or formatting errors that appear
  126. in this page are most likely
  127. to have been introduced during the conversion of the source files to
  128. man page format. To report such errors, see
  129. https://www.kernel.org/doc/man-pages/reporting_bugs.html .