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

sched_setparam.3p (4844B)


  1. '\" et
  2. .TH SCHED_SETPARAM "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. sched_setparam
  12. \(em set scheduling parameters
  13. (\fBREALTIME\fP)
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <sched.h>
  18. .P
  19. int sched_setparam(pid_t \fIpid\fP, const struct sched_param *\fIparam\fP);
  20. .fi
  21. .SH DESCRIPTION
  22. The
  23. \fIsched_setparam\fR()
  24. function shall set the scheduling parameters of the process specified by
  25. .IR pid
  26. to the values specified by the
  27. .BR sched_param
  28. structure pointed to by
  29. .IR param .
  30. The value of the
  31. .IR sched_priority
  32. member in the
  33. .BR sched_param
  34. structure shall be any integer within the inclusive priority range for
  35. the current scheduling policy of the process specified by
  36. .IR pid .
  37. Higher numerical values for the priority represent higher priorities.
  38. If the value of
  39. .IR pid
  40. is negative, the behavior of the
  41. \fIsched_setparam\fR()
  42. function is unspecified.
  43. .P
  44. If a process specified by
  45. .IR pid
  46. exists, and if the calling process has permission, the scheduling
  47. parameters shall be set for the process whose process ID is equal to
  48. .IR pid .
  49. .P
  50. If
  51. .IR pid
  52. is zero, the scheduling parameters shall be set for the calling process.
  53. .P
  54. The conditions under which one process has permission to change the
  55. scheduling parameters of another process are implementation-defined.
  56. .P
  57. Implementations may require the requesting process to have appropriate
  58. privileges to set its own scheduling parameters or those of another
  59. process.
  60. .P
  61. See
  62. .IR "Scheduling Policies"
  63. for a description on how this function affects the scheduling of
  64. the threads within the target process.
  65. .P
  66. If the current scheduling policy for the target process is not
  67. SCHED_FIFO, SCHED_RR,
  68. or SCHED_SPORADIC,
  69. the result is implementation-defined; this case includes the
  70. SCHED_OTHER policy.
  71. .P
  72. The specified
  73. .IR sched_ss_repl_period
  74. shall be greater than or equal to the specified
  75. .IR sched_ss_init_budget
  76. for the function to succeed; if it is not, then the function shall
  77. fail.
  78. .P
  79. The value of
  80. .IR sched_ss_max_repl
  81. shall be within the inclusive range [1,{SS_REPL_MAX}] for the function
  82. to succeed; if not, the function shall fail. It is unspecified whether the
  83. .IR sched_ss_repl_period
  84. and
  85. .IR sched_ss_init_budget
  86. values are stored as provided by this function or are rounded to
  87. align with the resolution of the clock being used.
  88. .P
  89. This function is not atomic with respect to other threads in the
  90. process. Threads may continue to execute while this function call is in
  91. the process of changing the scheduling policy for the underlying
  92. kernel-scheduled entities used by the process contention scope
  93. threads.
  94. .SH "RETURN VALUE"
  95. If successful, the
  96. \fIsched_setparam\fR()
  97. function shall return zero.
  98. .P
  99. If the call to
  100. \fIsched_setparam\fR()
  101. is unsuccessful, the priority shall remain unchanged, and the function
  102. shall return a value of \-1 and set
  103. .IR errno
  104. to indicate the error.
  105. .SH ERRORS
  106. The
  107. \fIsched_setparam\fR()
  108. function shall fail if:
  109. .TP
  110. .BR EINVAL
  111. One or more of the requested scheduling parameters is outside the range
  112. defined for the scheduling policy of the specified
  113. .IR pid .
  114. .TP
  115. .BR EPERM
  116. The requesting process does not have permission to set the scheduling
  117. parameters for the specified process, or does not have appropriate
  118. privileges to invoke
  119. \fIsched_setparam\fR().
  120. .TP
  121. .BR ESRCH
  122. No process can be found corresponding to that specified by
  123. .IR pid .
  124. .LP
  125. .IR "The following sections are informative."
  126. .SH EXAMPLES
  127. None.
  128. .SH "APPLICATION USAGE"
  129. None.
  130. .SH RATIONALE
  131. None.
  132. .SH "FUTURE DIRECTIONS"
  133. None.
  134. .SH "SEE ALSO"
  135. .IR "Scheduling Policies",
  136. .IR "\fIsched_getparam\fR\^(\|)",
  137. .IR "\fIsched_getscheduler\fR\^(\|)",
  138. .IR "\fIsched_setscheduler\fR\^(\|)"
  139. .P
  140. The Base Definitions volume of POSIX.1\(hy2017,
  141. .IR "\fB<sched.h>\fP"
  142. .\"
  143. .SH COPYRIGHT
  144. Portions of this text are reprinted and reproduced in electronic form
  145. from IEEE Std 1003.1-2017, Standard for Information Technology
  146. -- Portable Operating System Interface (POSIX), The Open Group Base
  147. Specifications Issue 7, 2018 Edition,
  148. Copyright (C) 2018 by the Institute of
  149. Electrical and Electronics Engineers, Inc and The Open Group.
  150. In the event of any discrepancy between this version and the original IEEE and
  151. The Open Group Standard, the original IEEE and The Open Group Standard
  152. is the referee document. The original Standard can be obtained online at
  153. http://www.opengroup.org/unix/online.html .
  154. .PP
  155. Any typographical or formatting errors that appear
  156. in this page are most likely
  157. to have been introduced during the conversion of the source files to
  158. man page format. To report such errors, see
  159. https://www.kernel.org/doc/man-pages/reporting_bugs.html .