1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, write to the Free
22 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
25 .\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
26 .\" First version written
27 .\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
30 .TH SCHED_RR_GET_INTERVAL 2 2007-04-06 "Linux" "Linux Programmer's Manual"
32 sched_rr_get_interval \- get the SCHED_RR interval for the named process
36 .BI "int sched_rr_get_interval(pid_t " pid ", struct timespec * " tp );
38 .BR sched_rr_get_interval ()
39 writes into the \fItimespec\fP structure pointed to by \fItp\fP the
40 round-robin time quantum for the process identified by \fIpid\fP.
42 The \fItimespec\fP structure has the following form:
47 time_t tv_sec; /* seconds */
48 long tv_nsec; /* nanoseconds */
54 \fIpid\fP is zero, the time quantum for the calling process is written
56 The identified process should be running under the
59 .\" FIXME . On Linux, sched_rr_get_interval()
60 .\" returns the timeslice for SCHED_OTHER processes -- this timeslice
61 .\" is influenced by the nice value.
62 .\" For SCHED_FIFO processes, this always returns 0.
64 .\" The round-robin time quantum value is not alterable under Linux
67 POSIX systems on which
68 .BR sched_rr_get_interval ()
70 .B _POSIX_PRIORITY_SCHEDULING
74 .BR sched_rr_get_interval ()
76 On error, \-1 is returned, and
82 Problem with copying information to userspace.
88 The system call is not yet implemented (only on rather old kernels).
91 The process whose ID is \fIpid\fP could not be found.
97 .\" From at least Linux 2.6.9, the following is no longer true
98 .\" for SCHED_RR processes. For RR processes the timeslice is always
99 .\" DEF_TIMESLICE, or 0.1 secs.
100 .\" Was the following really true for older kernels?
101 .\" Must build a 2.6.8 kernel and retest, and rewrite the following text
103 POSIX does not specify any mechanism for controlling the size of the
104 round-robin time quantum.
105 However, Linux provides a (nonportable) method of doing this.
106 The quantum can be controlled by adjusting the process's nice value (see
107 .BR setpriority (2)).
108 Assigning a negative (i.e., high) nice value results in a longer quantum;
109 assigning a positive (i.e., low) nice value results in a shorter quantum.
110 The default quantum is 0.1 seconds;
111 the degree to which changing the nice value affects the
112 quantum has varied somewhat across kernel versions.
114 .\" As of Linux 1.3.81
115 .\" .BR sched_rr_get_interval ()
116 .\" returns with error
117 .\" ENOSYS, because SCHED_RR has not yet been fully implemented and tested
120 .BR sched_setscheduler (2)
121 has a description of the Linux scheduling scheme.
123 .I Programming for the real world \- POSIX.4
124 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0