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_getclock.3p (3982B)


  1. '\" et
  2. .TH PTHREAD_CONDATTR_GETCLOCK "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_getclock,
  12. pthread_condattr_setclock
  13. \(em get and set the clock selection condition variable attribute
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <pthread.h>
  18. .P
  19. int pthread_condattr_getclock(const pthread_condattr_t *restrict \fIattr\fP,
  20. clockid_t *restrict \fIclock_id\fP);
  21. int pthread_condattr_setclock(pthread_condattr_t *\fIattr\fP,
  22. clockid_t \fIclock_id\fP);
  23. .fi
  24. .SH DESCRIPTION
  25. The
  26. \fIpthread_condattr_getclock\fR()
  27. function shall obtain the value of the
  28. .IR clock
  29. attribute from the attributes object referenced by
  30. .IR attr .
  31. .P
  32. The
  33. \fIpthread_condattr_setclock\fR()
  34. function shall set the
  35. .IR clock
  36. attribute in an initialized attributes object referenced by
  37. .IR attr .
  38. If
  39. \fIpthread_condattr_setclock\fR()
  40. is called with a
  41. .IR clock_id
  42. argument that refers to a CPU-time clock, the call shall fail.
  43. .P
  44. The
  45. .IR clock
  46. attribute is the clock ID of the clock that shall be used to
  47. measure the timeout service of
  48. \fIpthread_cond_timedwait\fR().
  49. The default value of the
  50. .IR clock
  51. attribute shall refer to the system clock.
  52. .P
  53. The behavior is undefined if the value specified by the
  54. .IR attr
  55. argument to
  56. \fIpthread_condattr_getclock\fR()
  57. or
  58. \fIpthread_condattr_setclock\fR()
  59. does not refer to an initialized condition variable attributes object.
  60. .SH "RETURN VALUE"
  61. If successful, the
  62. \fIpthread_condattr_getclock\fR()
  63. function shall return zero and store the value of the clock attribute
  64. of
  65. .IR attr
  66. into the object referenced by the
  67. .IR clock_id
  68. argument. Otherwise, an error number shall be returned to indicate the
  69. error.
  70. .P
  71. If successful, the
  72. \fIpthread_condattr_setclock\fR()
  73. function shall return zero; otherwise, an error number shall be
  74. returned to indicate the error.
  75. .SH ERRORS
  76. The
  77. \fIpthread_condattr_setclock\fR()
  78. function may fail if:
  79. .TP
  80. .BR EINVAL
  81. The value specified by
  82. .IR clock_id
  83. does not refer to a known clock, or is a CPU-time clock.
  84. .P
  85. These functions shall not return an error code of
  86. .BR [EINTR] .
  87. .LP
  88. .IR "The following sections are informative."
  89. .SH EXAMPLES
  90. None.
  91. .SH "APPLICATION USAGE"
  92. None.
  93. .SH RATIONALE
  94. If an implementation detects that the value specified by the
  95. .IR attr
  96. argument to
  97. \fIpthread_condattr_getclock\fR()
  98. or
  99. \fIpthread_condattr_setclock\fR()
  100. does not refer to an initialized condition variable attributes object,
  101. it is recommended that the function should fail and report an
  102. .BR [EINVAL]
  103. error.
  104. .SH "FUTURE DIRECTIONS"
  105. None.
  106. .SH "SEE ALSO"
  107. .ad l
  108. .IR "\fIpthread_cond_destroy\fR\^(\|)",
  109. .IR "\fIpthread_cond_timedwait\fR\^(\|)",
  110. .IR "\fIpthread_condattr_destroy\fR\^(\|)",
  111. .IR "\fIpthread_condattr_getpshared\fR\^(\|)",
  112. .IR "\fIpthread_create\fR\^(\|)",
  113. .IR "\fIpthread_mutex_destroy\fR\^(\|)"
  114. .ad b
  115. .P
  116. The Base Definitions volume of POSIX.1\(hy2017,
  117. .IR "\fB<pthread.h>\fP"
  118. .\"
  119. .SH COPYRIGHT
  120. Portions of this text are reprinted and reproduced in electronic form
  121. from IEEE Std 1003.1-2017, Standard for Information Technology
  122. -- Portable Operating System Interface (POSIX), The Open Group Base
  123. Specifications Issue 7, 2018 Edition,
  124. Copyright (C) 2018 by the Institute of
  125. Electrical and Electronics Engineers, Inc and The Open Group.
  126. In the event of any discrepancy between this version and the original IEEE and
  127. The Open Group Standard, the original IEEE and The Open Group Standard
  128. is the referee document. The original Standard can be obtained online at
  129. http://www.opengroup.org/unix/online.html .
  130. .PP
  131. Any typographical or formatting errors that appear
  132. in this page are most likely
  133. to have been introduced during the conversion of the source files to
  134. man page format. To report such errors, see
  135. https://www.kernel.org/doc/man-pages/reporting_bugs.html .