Initial import from FreeBSD RELENG_4:
[dragonfly.git] / lib / libcr / sys / sched_get_priority_max.2
1 .\" $FreeBSD: src/lib/libc/sys/sched_get_priority_max.2,v 1.3.2.9 2001/12/14 18:34:01 ru Exp $
2 .\" Copyright (c) 1998 HD Associates, Inc.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .Dd March 12, 1998
27 .Dt SCHED_GET_PRIORITY_MAX 2
28 .Os
29 .Sh NAME
30 .Nm sched_get_priority_max ,
31 .Nm sched_get_priority_min ,
32 .Nm sched_rr_get_interval
33 .Nd get scheduling parameter limits
34 .Sh LIBRARY
35 .Lb libc
36 .Sh SYNOPSIS
37 .In sched.h
38 .Ft int
39 .Fn sched_get_priority_max "int policy"
40 .Ft int
41 .Fn sched_get_priority_min "int policy"
42 .Ft int
43 .Fn sched_rr_get_interval "pid_t pid" "struct timespec *interval"
44 .Sh DESCRIPTION
45 The
46 .Fn sched_get_priority_max
47 and
48 .Fn sched_get_priority_min
49 functions return the appropriate maximum or minimum, respectively,
50 for the scheduling policy specified by
51 .Fa policy .
52 The
53 .Fn sched_rr_get_interval
54 function updates the
55 .Fa timespec
56 structure referenced by the
57 .Fa interval
58 argument to contain the current execution time limit (i.e., time
59 quantum) for the process specified by
60 .Fa pid .
61 If
62 .Fa pid
63 is zero, the current execution time limit for the calling process is
64 returned.
65 .Pp
66 The value of
67 .Fa policy
68 should be one of the scheduling policy values defined in
69 .Fa <sched.h> :
70 .Bl -tag -width [SCHED_OTHER]
71 .It Bq Er SCHED_FIFO
72 First-in-first-out fixed priority scheduling with no round robin scheduling;
73 .It Bq Er SCHED_OTHER
74 The standard time sharing scheduler;
75 .It Bq Er SCHED_RR
76 Round-robin scheduling across same priority processes.
77 .El
78 .Sh RETURN VALUES
79 If successful, the
80 .Fn sched_get_priority_max
81 and
82 .Fn sched_get_priority_min
83 functions shall return the appropriate maximum or minimum values,
84 respectively.  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 parameter 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 functions 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_setscheduler
117 and
118 .Fn sched_getscheduler
119 functions conform to
120 .St -p1003.1b-93 .