sched_get_priority_max.2 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. .\" Copyright (c) 1998 HD Associates, Inc.
  2. .\" All rights reserved.
  3. .\"
  4. .\" Redistribution and use in source and binary forms, with or without
  5. .\" modification, are permitted provided that the following conditions
  6. .\" are met:
  7. .\" 1. Redistributions of source code must retain the above copyright
  8. .\" notice, this list of conditions and the following disclaimer.
  9. .\" 2. Redistributions in binary form must reproduce the above copyright
  10. .\" notice, this list of conditions and the following disclaimer in the
  11. .\" documentation and/or other materials provided with the distribution.
  12. .\"
  13. .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  14. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  16. .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  17. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  18. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  19. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  20. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  21. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  22. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. .\" SUCH DAMAGE.
  24. .\"
  25. .Dd March 12, 1998
  26. .Dt SCHED_GET_PRIORITY_MAX 2
  27. .Os
  28. .Sh NAME
  29. .Nm sched_get_priority_max ,
  30. .Nm sched_get_priority_min ,
  31. .Nm sched_rr_get_interval
  32. .Nd get scheduling parameter limits
  33. .Sh LIBRARY
  34. .Lb libc
  35. .Sh SYNOPSIS
  36. .In sched.h
  37. .Ft int
  38. .Fn sched_get_priority_max "int policy"
  39. .Ft int
  40. .Fn sched_get_priority_min "int policy"
  41. .Ft int
  42. .Fn sched_rr_get_interval "pid_t pid" "struct timespec *interval"
  43. .Sh DESCRIPTION
  44. The
  45. .Fn sched_get_priority_max
  46. and
  47. .Fn sched_get_priority_min
  48. system calls return the appropriate maximum or minimum, respectively,
  49. for the scheduling policy specified by
  50. .Fa policy .
  51. The
  52. .Fn sched_rr_get_interval
  53. system call updates the
  54. .Fa timespec
  55. structure referenced by the
  56. .Fa interval
  57. argument to contain the current execution time limit (i.e., time
  58. quantum) for the process specified by
  59. .Fa pid .
  60. If
  61. .Fa pid
  62. is zero, the current execution time limit for the calling process is
  63. returned.
  64. .Pp
  65. The value of
  66. .Fa policy
  67. should be one of the scheduling policy values defined in
  68. .Fa <sched.h> :
  69. .Bl -tag -width [SCHED_OTHER]
  70. .It Bq Er SCHED_FIFO
  71. First-in-first-out fixed priority scheduling with no round robin scheduling;
  72. .It Bq Er SCHED_OTHER
  73. The standard time sharing scheduler;
  74. .It Bq Er SCHED_RR
  75. Round-robin scheduling across same priority processes.
  76. .El
  77. .Sh RETURN VALUES
  78. If successful, the
  79. .Fn sched_get_priority_max
  80. and
  81. .Fn sched_get_priority_min
  82. system calls shall return the appropriate maximum or minimum values,
  83. respectively.
  84. If unsuccessful, they shall return a value of -1 and set
  85. .Fa errno
  86. to indicate the error.
  87. .Pp
  88. .Rv -std sched_rr_get_interval
  89. .Sh ERRORS
  90. On failure
  91. .Va errno
  92. will be set to the corresponding value:
  93. .Bl -tag -width Er
  94. .It Bq Er EINVAL
  95. The value of the
  96. .Fa policy
  97. argument does not represent a defined scheduling policy.
  98. .It Bq Er ENOSYS
  99. The
  100. .Fn sched_get_priority_max ,
  101. .Fn sched_get_priority_min ,
  102. and
  103. .Fn sched_rr_get_interval
  104. system calls are not supported by the implementation.
  105. .It Bq Er ESRCH
  106. No process can be found corresponding to that specified by
  107. .Fa pid .
  108. .El
  109. .Sh SEE ALSO
  110. .Xr sched_getparam 2 ,
  111. .Xr sched_getscheduler 2 ,
  112. .Xr sched_setparam 2 ,
  113. .Xr sched_setscheduler 2
  114. .Sh STANDARDS
  115. The
  116. .Fn sched_get_priority_max ,
  117. .Fn sched_get_priority_min ,
  118. and
  119. .Fn sched_rr_get_interval
  120. system calls conform to
  121. .St -p1003.1b-93 .