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 45The 46.Fn sched_get_priority_max 47and 48.Fn sched_get_priority_min 49functions return the appropriate maximum or minimum, respectively, 50for the scheduling policy specified by 51.Fa policy . 52The 53.Fn sched_rr_get_interval 54function updates the 55.Fa timespec 56structure referenced by the 57.Fa interval 58argument to contain the current execution time limit (i.e., time 59quantum) for the process specified by 60.Fa pid . 61If 62.Fa pid 63is zero, the current execution time limit for the calling process is 64returned. 65.Pp 66The value of 67.Fa policy 68should 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 72First-in-first-out fixed priority scheduling with no round robin scheduling; 73.It Bq Er SCHED_OTHER 74The standard time sharing scheduler; 75.It Bq Er SCHED_RR 76Round-robin scheduling across same priority processes. 77.El 78.Sh RETURN VALUES 79If successful, the 80.Fn sched_get_priority_max 81and 82.Fn sched_get_priority_min 83functions shall return the appropriate maximum or minimum values, 84respectively. If unsuccessful, they shall return a value of -1 and set 85.Fa errno 86to indicate the error. 87.Pp 88.Rv -std sched_rr_get_interval 89.Sh ERRORS 90On failure 91.Va errno 92will be set to the corresponding value: 93.Bl -tag -width Er 94.It Bq Er EINVAL 95The value of the 96.Fa policy 97parameter does not represent a defined scheduling policy. 98.It Bq Er ENOSYS 99The 100.Fn sched_get_priority_max , 101.Fn sched_get_priority_min , 102and 103.Fn sched_rr_get_interval 104functions are not supported by the implementation. 105.It Bq Er ESRCH 106No 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 115The 116.Fn sched_setscheduler 117and 118.Fn sched_getscheduler 119functions conform to 120.St -p1003.1b-93 . 121