121e95dddSDavid Greenman.\" 221e95dddSDavid Greenman.\" Copyright (c) 1994, Henrik Vestergaard Draboel 321e95dddSDavid Greenman.\" All rights reserved. 421e95dddSDavid Greenman.\" 521e95dddSDavid Greenman.\" Redistribution and use in source and binary forms, with or without 621e95dddSDavid Greenman.\" modification, are permitted provided that the following conditions 721e95dddSDavid Greenman.\" are met: 821e95dddSDavid Greenman.\" 1. Redistributions of source code must retain the above copyright 921e95dddSDavid Greenman.\" notice, this list of conditions and the following disclaimer. 1021e95dddSDavid Greenman.\" 2. Redistributions in binary form must reproduce the above copyright 1121e95dddSDavid Greenman.\" notice, this list of conditions and the following disclaimer in the 1221e95dddSDavid Greenman.\" documentation and/or other materials provided with the distribution. 1321e95dddSDavid Greenman.\" 3. All advertising materials mentioning features or use of this software 1421e95dddSDavid Greenman.\" must display the following acknowledgement: 1521e95dddSDavid Greenman.\" This product includes software developed by Henrik Vestergaard Draboel. 1621e95dddSDavid Greenman.\" 4. The name of the author may not be used to endorse or promote products 1721e95dddSDavid Greenman.\" derived from this software without specific prior written permission. 1821e95dddSDavid Greenman.\" 1921e95dddSDavid Greenman.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 2021e95dddSDavid Greenman.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2121e95dddSDavid Greenman.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2221e95dddSDavid Greenman.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2321e95dddSDavid Greenman.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2421e95dddSDavid Greenman.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2521e95dddSDavid Greenman.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2621e95dddSDavid Greenman.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2721e95dddSDavid Greenman.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2821e95dddSDavid Greenman.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2921e95dddSDavid Greenman.\" SUCH DAMAGE. 3021e95dddSDavid Greenman.\" 3121e95dddSDavid Greenman.\" $Id$ 3221e95dddSDavid Greenman.\" 3321e95dddSDavid Greenman.Dd July 23, 1994 3421e95dddSDavid Greenman.Dt RTPRIO 1 3521e95dddSDavid Greenman.Os 3621e95dddSDavid Greenman.Sh NAME 3721e95dddSDavid Greenman.Nm rtprio 3821e95dddSDavid Greenman.Nd execute, examine or modify a utilitys or process realtime scheduling priority 3921e95dddSDavid Greenman.Sh SYNOPSIS 4021e95dddSDavid Greenman 4121e95dddSDavid Greenman.Nm rtprio 4221e95dddSDavid Greenman.Nm rtprio 4321e95dddSDavid Greenman.Ar pid 4421e95dddSDavid Greenman.Nm rtprio 4521e95dddSDavid Greenman.Ar priority 4621e95dddSDavid Greenman.Ar command 4721e95dddSDavid Greenman.Op args 4821e95dddSDavid Greenman.Nm rtprio 4921e95dddSDavid Greenman.Ar priority 5021e95dddSDavid Greenman.Ar -pid 5121e95dddSDavid Greenman.Nm rtprio 5221e95dddSDavid Greenman.Ar -t 5321e95dddSDavid Greenman.Ar command 5421e95dddSDavid Greenman.Op args 5521e95dddSDavid Greenman.Nm rtprio 5621e95dddSDavid Greenman.Ar -t 5721e95dddSDavid Greenman.Ar -pid 5821e95dddSDavid Greenman.Sh DESCRIPTION 5921e95dddSDavid Greenman.Nm Rtprio 6021e95dddSDavid Greenmanis used for controlling realtime process scheduling. A process with a 6121e95dddSDavid Greenmanrealtime priority is not subject to priority degradation, and will only 6221e95dddSDavid Greenmanbe preempted by another process of equal or higher realtime priority. 6321e95dddSDavid Greenman 6421e95dddSDavid Greenman.Nm Rtprio 6521e95dddSDavid Greenmancalled without arguments, will return the realtime priority 6621e95dddSDavid Greenmanof the current process. 6721e95dddSDavid Greenman 6821e95dddSDavid GreenmanIf 6921e95dddSDavid Greenman.Nm rtprio 7021e95dddSDavid Greenmanis called with 1 argument, it will return the realtime priority 7121e95dddSDavid Greenmanof the process with the specified 7221e95dddSDavid Greenman.Ar pid . 7321e95dddSDavid Greenman 7421e95dddSDavid GreenmanIf 7521e95dddSDavid Greenman.Ar priority 7621e95dddSDavid Greenmanis specified, the process or program is run at that realtime priority. 7721e95dddSDavid GreenmanIf 7821e95dddSDavid Greenman.Ar -t 7921e95dddSDavid Greenmanis specified, the process or program is run as a normal (non-realtime) 8021e95dddSDavid Greenmanprocess. 8121e95dddSDavid Greenman 8221e95dddSDavid GreenmanIf 8321e95dddSDavid Greenman.Ar -pid 8421e95dddSDavid Greenmanis specified, the process with that pid will be modified, else 8521e95dddSDavid Greenmanif 8621e95dddSDavid Greenman.Ar command 8721e95dddSDavid Greenmanis specified, that program is run with its arguments. 8821e95dddSDavid Greenman 8921e95dddSDavid Greenman.Ar Priority 9021e95dddSDavid Greenmanis an integer between 0 (RTPRIO_MIN) and 31 (RTPRIO_MAX). 0 is the 9121e95dddSDavid Greenmanhighest priority 9221e95dddSDavid Greenman 9321e95dddSDavid Greenman.Ar Pid 9421e95dddSDavid Greenmanof 0 means "the current process". 9521e95dddSDavid Greenman 9621e95dddSDavid GreenmanOnly root is allowed to set realtime priorities. 9721e95dddSDavid Greenman.Sh RETURN VALUE 9821e95dddSDavid Greenman.Nm rtprio 9921e95dddSDavid Greenmanreturns the (new) realtime priority of the process (see rtprio(2)), or 10021e95dddSDavid Greenman-1 for all usage errors. 10121e95dddSDavid Greenman.Sh EXAMPLES 10221e95dddSDavid Greenman.\LP 10321e95dddSDavid Greenman 10421e95dddSDavid GreenmanTo see which realtime priority the current process is at: 10521e95dddSDavid Greenman.Bd -literal -offset indent -compact 10621e95dddSDavid Greenman\fBrtprio\fP 10721e95dddSDavid Greenman.Ed 10821e95dddSDavid Greenman 10921e95dddSDavid Greenman.\.LP 11021e95dddSDavid GreenmanTo see which realtime priority of process \fI1423\fP: 11121e95dddSDavid Greenman.Bd -literal -offset indent -compact 11221e95dddSDavid Greenman\fBrtprio 1423\fP 11321e95dddSDavid Greenman.Ed 11421e95dddSDavid Greenman 11521e95dddSDavid Greenman.\.LP 11621e95dddSDavid GreenmanTo run \fIcron\fP at the lowest realtime priority: 11721e95dddSDavid Greenman.Bd -literal -offset indent -compact 11821e95dddSDavid Greenman\fBrtprio 31 cron\fP 11921e95dddSDavid Greenman.Ed 12021e95dddSDavid Greenman 12121e95dddSDavid Greenman.\.LP 12221e95dddSDavid GreenmanTo change the realtime priority of process \fI1423\fP to \fI16\fP: 12321e95dddSDavid Greenman.Bd -literal -offset indent -compact 12421e95dddSDavid Greenman\fBrtprio 16 -1423\fP 12521e95dddSDavid Greenman.Ed 12621e95dddSDavid Greenman 12721e95dddSDavid Greenman.\.LP 12821e95dddSDavid GreenmanTo run \fItcpdump\fP without realtime priority: 12921e95dddSDavid Greenman.Bd -literal -offset indent -compact 13021e95dddSDavid Greenman\fBrtprio -t tcpdump\fP 13121e95dddSDavid Greenman.Ed 13221e95dddSDavid Greenman 13321e95dddSDavid Greenman.\.LP 13421e95dddSDavid GreenmanTo change the realtime priority of process \fI1423\fP to RTRIO_RTOFF 13521e95dddSDavid Greenman(no realtime): 13621e95dddSDavid Greenman.Bd -literal -offset indent -compact 13721e95dddSDavid Greenman\fBrtprio -t -1423\fP 13821e95dddSDavid Greenman.Ed 13921e95dddSDavid Greenman.Sh DIAGNOSTICS 14021e95dddSDavid GreenmanThe 14121e95dddSDavid Greenman.Nm rtprio 14221e95dddSDavid Greenmanutility shall exit with value of the (new) realtime priority of the 14321e95dddSDavid Greenmanprogram. 14421e95dddSDavid Greenman.Sh SEE ALSO 14521e95dddSDavid Greenman.Xr rtprio 2 , 14621e95dddSDavid Greenman.Xr nice 1 , 14721e95dddSDavid Greenman.Xr ps 1 , 14821e95dddSDavid Greenman.Xr nice 2 , 14921e95dddSDavid Greenman.Xr renice 8 15021e95dddSDavid Greenman.Sh HISTORY 15121e95dddSDavid GreenmanThe 15221e95dddSDavid Greenman.Nm rtprio 15321e95dddSDavid Greenmanutility appeared in 15421e95dddSDavid GreenmanFreeBSD 2.0, 15521e95dddSDavid Greenmanbut is similar to the HP-UX version. 15621e95dddSDavid Greenman.Sh BUGS 15721e95dddSDavid GreenmanYou can lock you're self out of the system, be placing at cpu-heavy 15821e95dddSDavid Greenmanprocess in a realtime priority. 15921e95dddSDavid Greenman 16021e95dddSDavid GreenmanThere is no way to set/view the realtime priority of process 0 16121e95dddSDavid Greenman(swapper) (see ps(1)). 16221e95dddSDavid Greenman 16321e95dddSDavid GreenmanOthers ... 16421e95dddSDavid Greenman.Sh AUTHOR 16521e95dddSDavid GreenmanHenrik Vestergaard Draboel - hvd@terry.ping.dk 166