1 .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
24 .\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
25 .\" First version written
26 .\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
29 .TH SCHED_RR_GET_INTERVAL 2 2014-04-28 "Linux" "Linux Programmer's Manual"
31 sched_rr_get_interval \- get the SCHED_RR interval for the named process
35 .BI "int sched_rr_get_interval(pid_t " pid ", struct timespec * " tp );
37 .BR sched_rr_get_interval ()
40 structure pointed to by
42 the round-robin time quantum for the process identified by
44 The specified process should be running under the
50 structure has the following form:
55 time_t tv_sec; /* seconds */
56 long tv_nsec; /* nanoseconds */
63 is zero, the time quantum for the calling process is written into
65 .\" FIXME . On Linux, sched_rr_get_interval()
66 .\" returns the timeslice for SCHED_OTHER processes -- this timeslice
67 .\" is influenced by the nice value.
68 .\" For SCHED_FIFO processes, this always returns 0.
70 .\" The round-robin time quantum value is not alterable under Linux
75 .BR sched_rr_get_interval ()
77 On error, \-1 is returned, and
83 Problem with copying information to user space.
89 The system call is not yet implemented (only on rather old kernels).
92 Could not find a process with the ID
97 POSIX systems on which
98 .BR sched_rr_get_interval ()
100 .B _POSIX_PRIORITY_SCHEDULING
104 POSIX does not specify any mechanism for controlling the size of the
105 round-robin time quantum.
106 Older Linux kernels provide a (nonportable) method of doing this.
107 The quantum can be controlled by adjusting the process's nice value (see
108 .BR setpriority (2)).
109 Assigning a negative (i.e., high) nice value results in a longer quantum;
110 assigning a positive (i.e., low) nice value results in a shorter quantum.
111 The default quantum is 0.1 seconds;
112 the degree to which changing the nice value affects the
113 quantum has varied somewhat across kernel versions.
114 This method of adjusting the quantum was removed
115 .\" commit a4ec24b48ddef1e93f7578be53270f0b95ad666c
116 starting with Linux 2.6.24.
119 .\" commit ce0dbbbb30aee6a835511d5be446462388ba9eee
120 a new mechanism for adjusting (and viewing) the
123 .I /proc/sys/kernel/sched_rr_timeslice_ms
124 file exposes the quantum as a millisecond value, whose default is 100.
125 Writing 0 to this file resets the quantum to the default value.
127 .\" As of Linux 1.3.81
128 .\" .BR sched_rr_get_interval ()
129 .\" returns with error
130 .\" ENOSYS, because SCHED_RR has not yet been fully implemented and tested
135 This page is part of release 3.68 of the Linux
138 A description of the project,
139 information about reporting bugs,
140 and the latest version of this page,
142 \%http://www.kernel.org/doc/man\-pages/.