NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | VERSIONS | STANDARDS | HISTORY | NOTES | SEE ALSO | COLOPHON |
|
|
sched_rr_get_interval(2) System Calls Manual sched_rr_get_interval(2)
sched_rr_get_interval - get the SCHED_RR interval for the named process
Standard C library (libc, -lc)
#include <sched.h> int sched_rr_get_interval(pid_t pid, struct timespec *tp);
sched_rr_get_interval() writes into the timespec(3) structure pointed to by tp the round-robin time quantum for the process identified by pid. The specified process should be running under the SCHED_RR scheduling policy. If pid is zero, the time quantum for the calling process is written into *tp.
On success, sched_rr_get_interval() returns 0. On error, -1 is returned, and errno is set to indicate the error.
EFAULT Problem with copying information to user space. EINVAL Invalid pid. ENOSYS The system call is not yet implemented (only on rather old kernels). ESRCH Could not find a process with the ID pid.
Linux Linux 3.9 added a new mechanism for adjusting (and viewing) the SCHED_RR quantum: the /proc/sys/kernel/sched_rr_timeslice_ms file exposes the quantum as a millisecond value, whose default is 100. Writing 0 to this file resets the quantum to the default value.
POSIX.1-2008.
POSIX.1-2001. Linux POSIX does not specify any mechanism for controlling the size of the round-robin time quantum. Older Linux kernels provide a (nonportable) method of doing this. The quantum can be controlled by adjusting the process's nice value (see setpriority(2)). Assigning a negative (i.e., high) nice value results in a longer quantum; assigning a positive (i.e., low) nice value results in a shorter quantum. The default quantum is 0.1 seconds; the degree to which changing the nice value affects the quantum has varied somewhat across kernel versions. This method of adjusting the quantum was removed starting with Linux 2.6.24.
POSIX systems on which sched_rr_get_interval() is available define _POSIX_PRIORITY_SCHEDULING in <unistd.h>.
timespec(3), sched(7)
This page is part of the man-pages (Linux kernel and C library
user-space interface documentation) project. Information about
the project can be found at
⟨https://www.kernel.org/doc/man-pages/⟩. If you have a bug report
for this manual page, see
⟨https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING⟩.
This page was obtained from the tarball man-pages-6.9.1.tar.gz
fetched from
⟨https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/⟩ on
2024-06-26. If you discover any rendering problems in this HTML
version of the page, or you believe there is a better or more up-
to-date source for the page, or you have corrections or
improvements to the information in this COLOPHON (which is not
part of the original manual page), send a mail to
[email protected]
Linux man-pages 6.9.1 2024-05-02 sched_rr_get_interval(2)
Pages that refer to this page: sched_setattr(2), sched_setscheduler(2), syscalls(2), proc_sys_kernel(5), sched(7)