*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> rtprio (2)              



NAME    [Toc]    [Back]

     rtprio -- examine or modify a process realtime or idle priority

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <sys/rtprio.h>

     rtprio(int function, pid_t pid, struct rtprio *rtp);

DESCRIPTION    [Toc]    [Back]

     The rtprio() system call is used to lookup or change the realtime or idle
     priority of a process.

     The function argument specifies the operation to be performed.
     RTP_LOOKUP to lookup the current priority, and RTP_SET to set the priority.
  The pid argument specifies the process to be used, 0 for the current

     The *rtp argument is a pointer to a struct rtprio which is used to specify
 the priority and priority type.  This structure has the following

     struct rtprio {
	     u_short type;
	     u_short prio;

     The value of the type field may be RTP_PRIO_REALTIME for realtime priorities,
 RTP_PRIO_NORMAL for normal priorities, and RTP_PRIO_IDLE for idle
     priorities.  The priority specified by the prio field ranges between 0
     and RTP_PRIO_MAX (usually 31).  0 is the highest possible priority.

     Realtime and idle priority is inherited through fork() and exec().

     A realtime process can only be preempted by a process of equal or higher
     priority, or by an interrupt; idle priority processes will run only when
     no other real/normal priority process is runnable.  Higher real/idle priority
 processes preempt lower real/idle priority processes.  Processes of
     equal real/idle priority are run round-robin.

RETURN VALUES    [Toc]    [Back]

     The rtprio() function returns the value 0 if successful; otherwise the
     value -1 is returned and the global variable errno is set to indicate the

ERRORS    [Toc]    [Back]

     The rtprio() system call will fail if

     [EINVAL]		The specified prio was out of range.

     [EPERM]		The calling process is not allowed to set the realtime
			priority.  Only root is allowed to change the realtime
			priority of any process, and non-root may only change
			the idle priority of the current process.

     [ESRCH]		The specified process was not found.

AUTHORS    [Toc]    [Back]

     The original author was Henrik Vestergaard Draboel <hvd@terry.ping.dk>.
     This implementation in FreeBSD was substantially rewritten by David

SEE ALSO    [Toc]    [Back]

     nice(1), ps(1), rtprio(1), setpriority(2), nice(3), renice(8)

FreeBSD 5.2.1			 July 23, 1994			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
rtprio FreeBSD execute, examine or modify a utility's or process's realtime or idletime scheduling priority
idprio FreeBSD execute, examine or modify a utility's or process's realtime or idletime scheduling priority
npri IRIX modify the scheduling priority of a process
idle Linux make process 0 idle
update IRIX Process pending events and/or when-idle handlers
rtsched_numpri HP-UX number of priority values to support for POSIX.1b realtime applications
cvmeter IRIX examine process resource consumption data
splserial OpenBSD modify system interrupt priority level
splserial NetBSD modify system interrupt priority level
spl OpenBSD modify system interrupt priority level
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service