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_attr_getscope.3p (3911B)


  1. '\" et
  2. .TH PTHREAD_ATTR_GETSCOPE "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_attr_getscope,
  12. pthread_attr_setscope
  13. \(em get and set the contentionscope attribute
  14. (\fBREALTIME THREADS\fP)
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <pthread.h>
  19. .P
  20. int pthread_attr_getscope(const pthread_attr_t *restrict \fIattr\fP,
  21. int *restrict \fIcontentionscope\fP);
  22. int pthread_attr_setscope(pthread_attr_t *\fIattr\fP, int \fIcontentionscope\fP);
  23. .fi
  24. .SH DESCRIPTION
  25. The
  26. \fIpthread_attr_getscope\fR()
  27. and
  28. \fIpthread_attr_setscope\fR()
  29. functions, respectively, shall get and set the
  30. .IR contentionscope
  31. attribute in the
  32. .IR attr
  33. object.
  34. .P
  35. The
  36. .IR contentionscope
  37. attribute may have the values PTHREAD_SCOPE_SYSTEM,
  38. signifying system scheduling contention scope, or
  39. PTHREAD_SCOPE_PROCESS,
  40. signifying process scheduling contention scope. The symbols
  41. PTHREAD_SCOPE_SYSTEM and PTHREAD_SCOPE_PROCESS are defined in the
  42. .IR <pthread.h>
  43. header.
  44. .P
  45. The behavior is undefined if the value specified by the
  46. .IR attr
  47. argument to
  48. \fIpthread_attr_getscope\fR()
  49. or
  50. \fIpthread_attr_setscope\fR()
  51. does not refer to an initialized thread attributes object.
  52. .SH "RETURN VALUE"
  53. If successful, the
  54. \fIpthread_attr_getscope\fR()
  55. and
  56. \fIpthread_attr_setscope\fR()
  57. functions shall return zero; otherwise, an error number shall be
  58. returned to indicate the error.
  59. .SH ERRORS
  60. The
  61. \fIpthread_attr_setscope\fR()
  62. function shall fail if:
  63. .TP
  64. .BR ENOTSUP
  65. An attempt was made to set the attribute to an unsupported value.
  66. .P
  67. The
  68. \fIpthread_attr_setscope\fR()
  69. function may fail if:
  70. .TP
  71. .BR EINVAL
  72. The value of
  73. .IR contentionscope
  74. is not valid.
  75. .P
  76. These functions shall not return an error code of
  77. .BR [EINTR] .
  78. .LP
  79. .IR "The following sections are informative."
  80. .SH EXAMPLES
  81. None.
  82. .SH "APPLICATION USAGE"
  83. After these attributes have been set, a thread can be created with the
  84. specified attributes using
  85. \fIpthread_create\fR().
  86. Using these routines does not affect the current running thread.
  87. .P
  88. See
  89. .IR "Section 2.9.4" ", " "Thread Scheduling"
  90. for further details on thread scheduling attributes and their default
  91. settings.
  92. .SH RATIONALE
  93. If an implementation detects that the value specified by the
  94. .IR attr
  95. argument to
  96. \fIpthread_attr_getscope\fR()
  97. or
  98. \fIpthread_attr_setscope\fR()
  99. does not refer to an initialized thread attributes object, it is
  100. recommended that the function should fail and report an
  101. .BR [EINVAL]
  102. error.
  103. .SH "FUTURE DIRECTIONS"
  104. None.
  105. .SH "SEE ALSO"
  106. .ad l
  107. .IR "\fIpthread_attr_destroy\fR\^(\|)",
  108. .IR "\fIpthread_attr_getinheritsched\fR\^(\|)",
  109. .IR "\fIpthread_attr_getschedpolicy\fR\^(\|)",
  110. .IR "\fIpthread_attr_getschedparam\fR\^(\|)",
  111. .IR "\fIpthread_create\fR\^(\|)"
  112. .ad b
  113. .P
  114. The Base Definitions volume of POSIX.1\(hy2017,
  115. .IR "\fB<pthread.h>\fP",
  116. .IR "\fB<sched.h>\fP"
  117. .\"
  118. .SH COPYRIGHT
  119. Portions of this text are reprinted and reproduced in electronic form
  120. from IEEE Std 1003.1-2017, Standard for Information Technology
  121. -- Portable Operating System Interface (POSIX), The Open Group Base
  122. Specifications Issue 7, 2018 Edition,
  123. Copyright (C) 2018 by the Institute of
  124. Electrical and Electronics Engineers, Inc and The Open Group.
  125. In the event of any discrepancy between this version and the original IEEE and
  126. The Open Group Standard, the original IEEE and The Open Group Standard
  127. is the referee document. The original Standard can be obtained online at
  128. http://www.opengroup.org/unix/online.html .
  129. .PP
  130. Any typographical or formatting errors that appear
  131. in this page are most likely
  132. to have been introduced during the conversion of the source files to
  133. man page format. To report such errors, see
  134. https://www.kernel.org/doc/man-pages/reporting_bugs.html .