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_getschedpolicy.3p (3987B)


  1. '\" et
  2. .TH PTHREAD_ATTR_GETSCHEDPOLICY "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_getschedpolicy,
  12. pthread_attr_setschedpolicy
  13. \(em get and set the schedpolicy attribute
  14. (\fBREALTIME THREADS\fP)
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <pthread.h>
  19. .P
  20. int pthread_attr_getschedpolicy(const pthread_attr_t *restrict \fIattr\fP,
  21. int *restrict \fIpolicy\fP);
  22. int pthread_attr_setschedpolicy(pthread_attr_t *\fIattr\fP, int \fIpolicy\fP);
  23. .fi
  24. .SH DESCRIPTION
  25. The
  26. \fIpthread_attr_getschedpolicy\fR()
  27. and
  28. \fIpthread_attr_setschedpolicy\fR()
  29. functions, respectively, shall get and set the
  30. .IR schedpolicy
  31. attribute in the
  32. .IR attr
  33. argument.
  34. .P
  35. The supported values of
  36. .IR policy
  37. shall include SCHED_FIFO, SCHED_RR, and SCHED_OTHER,
  38. which are defined in the
  39. .IR <sched.h>
  40. header. When threads executing with the scheduling policy SCHED_FIFO,
  41. SCHED_RR,
  42. or SCHED_SPORADIC
  43. are waiting on a mutex, they shall acquire the mutex in priority order
  44. when the mutex is unlocked.
  45. .P
  46. The behavior is undefined if the value specified by the
  47. .IR attr
  48. argument to
  49. \fIpthread_attr_getschedpolicy\fR()
  50. or
  51. \fIpthread_attr_setschedpolicy\fR()
  52. does not refer to an initialized thread attributes object.
  53. .SH "RETURN VALUE"
  54. If successful, the
  55. \fIpthread_attr_getschedpolicy\fR()
  56. and
  57. \fIpthread_attr_setschedpolicy\fR()
  58. functions shall return zero; otherwise, an error number shall be
  59. returned to indicate the error.
  60. .SH ERRORS
  61. The
  62. \fIpthread_attr_setschedpolicy\fR()
  63. function shall fail if:
  64. .TP
  65. .BR ENOTSUP
  66. An attempt was made to set the attribute to an unsupported value.
  67. .P
  68. The
  69. \fIpthread_attr_setschedpolicy\fR()
  70. function may fail if:
  71. .TP
  72. .BR EINVAL
  73. The value of
  74. .IR policy
  75. is not valid.
  76. .P
  77. These functions shall not return an error code of
  78. .BR [EINTR] .
  79. .LP
  80. .IR "The following sections are informative."
  81. .SH EXAMPLES
  82. None.
  83. .SH "APPLICATION USAGE"
  84. After these attributes have been set, a thread can be created with the
  85. specified attributes using
  86. \fIpthread_create\fR().
  87. Using these routines does not affect the current running thread.
  88. .P
  89. See
  90. .IR "Section 2.9.4" ", " "Thread Scheduling"
  91. for further details on thread scheduling attributes and their
  92. default settings.
  93. .SH RATIONALE
  94. If an implementation detects that the value specified by the
  95. .IR attr
  96. argument to
  97. \fIpthread_attr_getschedpolicy\fR()
  98. or
  99. \fIpthread_attr_setschedpolicy\fR()
  100. does not refer to an initialized thread attributes object, it is
  101. 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_attr_destroy\fR\^(\|)",
  109. .IR "\fIpthread_attr_getscope\fR\^(\|)",
  110. .IR "\fIpthread_attr_getinheritsched\fR\^(\|)",
  111. .IR "\fIpthread_attr_getschedparam\fR\^(\|)",
  112. .IR "\fIpthread_create\fR\^(\|)"
  113. .ad b
  114. .P
  115. The Base Definitions volume of POSIX.1\(hy2017,
  116. .IR "\fB<pthread.h>\fP",
  117. .IR "\fB<sched.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 .