1 .\" Copyright (c) 1994, Henrik Vestergaard Draboel
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by Henrik Vestergaard Draboel.
15 .\" 4. The name of the author may not be used to endorse or promote products
16 .\" derived from this software without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" $FreeBSD: src/lib/libc/sys/rtprio.2,v 1.13.2.9 2001/12/14 18:34:01 ru Exp $
31 .\" $DragonFly: src/lib/libc/sys/rtprio.2,v 1.6 2007/12/14 23:12:55 swildner Exp $
39 .Nd examine or modify a process/lwp realtime or idle priority
46 .Fn rtprio "int function" "pid_t pid" "struct rtprio *rtp"
48 .Fn lwp_rtprio "int function" "pid_t pid" "lwpid_t tid" "struct rtprio *rtp"
51 is used to lookup or change the realtime or idle priority of a process.
54 specifies the operation to be performed.
56 to lookup the current priority, and
60 specifies the process to be used, 0 for the current process.
65 which is used to specify the priority and priority type.
66 This structure has the following form:
78 for realtime priorities,
80 for normal priorities, and
83 The priority specified by the
85 field ranges between 0 and
86 .Dv RTP_PRIO_MAX (usually 31) .
87 0 is the highest possible priority.
89 Realtime and idle priority is inherited through
94 A realtime process can only be preempted by a process of equal or
95 higher priority, or by an interrupt; idle priority processes will run only
96 when no other real/normal priority process is runnable.
97 Higher real/idle priority processes
98 preempt lower real/idle priority processes.
99 Processes of equal real/idle priority are run round-robin.
103 function is the lwp counterpart of
105 It takes one additional argument,
107 specifying the lwp to be used, -1 for the current lwp.
109 .Rv -std rtprio lwp_rtprio
121 The calling process is not allowed to set the realtime priority.
123 root is allowed to change the realtime priority of any process, and non-root
124 may only change the idle priority of the current process.
126 The specified process was not found.
137 The original author was
138 .An Henrik Vestergaard Draboel Aq hvd@terry.ping.dk .
139 This implementation was substantially rewritten by