sched_rr_get_interval()

Updated: April 19, 2023

Get the execution time limit of a process

Synopsis:

#include <sched.h>

int sched_rr_get_interval( 
                 pid_t pid,
                 struct timespec * interval );

Arguments:

pid
The process ID whose execution time limit you want to get.
interval
A pointer to a timespec structure that the function updates with the process's current execution time limit.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The sched_rr_get_interval() function updates interval with the current execution time limit (what POSIX calls the “time quantum”) for the process, pid. If pid is 0, the current execution time limit for the calling process is returned.

In QNX Neutrino, this value is the timeslice for the SCHED_RR scheduling policy.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

ESRCH
The process pid can't be found.

Classification:

POSIX 1003.1 PS|TPS

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes