sched_rr_get_interval2
Get the sched_rr interval for the named process
Usage
#include <sched.h>
int sched_rr_get_interval(pid_t pid, struct timespec *tp);
Library
Standard C library (libc, -lc)
Overview
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.
Return value
On success, sched_rr_get_interval() returns 0. On error, -1 is returned, and errno is set to indicate the error.
Errors
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. |
Versions
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.
Notes
POSIX systems on which sched_rr_get_interval() is available define _POSIX_PRIORITY_SCHEDULING in <unistd.h>.
Releases
19 releases since Debian 1.1 (Buzz); the text changed 15 times.