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_condattr_getpshared.3p (4069B)


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