1 | .TH GETPRIORITY 2 "Jul 1, 2005"
|
---|
2 | .UC 4
|
---|
3 | .SH NAME
|
---|
4 | getpriority, setpriority \- get and set scheduling priority
|
---|
5 | .SH SYNOPSIS
|
---|
6 | .nf
|
---|
7 | .ft B
|
---|
8 | #include <sys/resource.h>
|
---|
9 |
|
---|
10 | int getpriority(int \fIwhich\fP, int \fIwho\fP)
|
---|
11 | int setpriority(int \fIwhich\fP, int \fIwho\fP, int \fIprio\fP)
|
---|
12 | .SH DESCRIPTION
|
---|
13 | .B Getpriority
|
---|
14 | returns the scheduling priority of the process, process group, or user
|
---|
15 | referred to in \fIwho\fP. Which of the three is indicated in
|
---|
16 | \fIwhich\fP, by PRIO_PROCESS, PRIO_PGRP and PRIO_USER, respectively.
|
---|
17 | In MINIX 3, currently only PRIO_PROCESS is implemented.
|
---|
18 |
|
---|
19 | The range of the returned value is between PRIO_MIN and PRIO_MAX,
|
---|
20 | currently between -20 and 20, and is the so-called nice value of
|
---|
21 | a process. The higher the nice value, the less favourable the scheduling
|
---|
22 | priority.
|
---|
23 |
|
---|
24 | .B Setpriority
|
---|
25 | sets the priority indicated by \fIwho\fP and \fIwhich\fP to \fIprio\fP.
|
---|
26 | \fIprio\fP, which is the nice value, may only be lowered by the super-user.
|
---|
27 | .SH RETURN VALUES
|
---|
28 | These functions both return -1 on failure, and set errno in this case.
|
---|
29 | Because
|
---|
30 | .B getpriority
|
---|
31 | can return -1 as the real nice value, the caller has to reset errno
|
---|
32 | and check errno afterwards to distinguish between an error condition
|
---|
33 | and a negative nice value.
|
---|
34 | .SH SEE ALSO
|
---|
35 | nice(1)
|
---|
36 | .SH AUTHOR
|
---|
37 | Ben Gras <beng@few.vu.nl>
|
---|