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