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