1 .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
6 .\" First version written
7 .\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
10 .TH SCHED_RR_GET_INTERVAL 2 2022-09-09 "Linux man-pages (unreleased)"
12 sched_rr_get_interval \- get the SCHED_RR interval for the named process
15 .RI ( libc ", " \-lc )
20 .BI "int sched_rr_get_interval(pid_t " pid ", struct timespec *" tp );
23 .BR sched_rr_get_interval ()
26 structure pointed to by
28 the round-robin time quantum for the process identified by
30 The specified process should be running under the
36 is zero, the time quantum for the calling process is written into
38 .\" FIXME . On Linux, sched_rr_get_interval()
39 .\" returns the timeslice for SCHED_OTHER processes -- this timeslice
40 .\" is influenced by the nice value.
41 .\" For SCHED_FIFO processes, this always returns 0.
43 .\" The round-robin time quantum value is not alterable under Linux
48 .BR sched_rr_get_interval ()
50 On error, \-1 is returned, and
52 is set to indicate the error.
56 Problem with copying information to user space.
62 The system call is not yet implemented (only on rather old kernels).
65 Could not find a process with the ID
68 POSIX.1-2001, POSIX.1-2008.
70 POSIX systems on which
71 .BR sched_rr_get_interval ()
73 .B _POSIX_PRIORITY_SCHEDULING
77 POSIX does not specify any mechanism for controlling the size of the
78 round-robin time quantum.
79 Older Linux kernels provide a (nonportable) method of doing this.
80 The quantum can be controlled by adjusting the process's nice value (see
82 Assigning a negative (i.e., high) nice value results in a longer quantum;
83 assigning a positive (i.e., low) nice value results in a shorter quantum.
84 The default quantum is 0.1 seconds;
85 the degree to which changing the nice value affects the
86 quantum has varied somewhat across kernel versions.
87 This method of adjusting the quantum was removed
88 .\" commit a4ec24b48ddef1e93f7578be53270f0b95ad666c
89 starting with Linux 2.6.24.
92 .\" commit ce0dbbbb30aee6a835511d5be446462388ba9eee
93 a new mechanism for adjusting (and viewing) the
96 .I /proc/sys/kernel/sched_rr_timeslice_ms
97 file exposes the quantum as a millisecond value, whose default is 100.
98 Writing 0 to this file resets the quantum to the default value.
100 .\" As of Linux 1.3.81
101 .\" .BR sched_rr_get_interval ()
102 .\" returns with error
103 .\" ENOSYS, because SCHED_RR has not yet been fully implemented and tested