posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
_POSIX_PRIORITY_SCHEDULING

POSIX Priority Scheduling option. More...

Macros

#define SCHED_OTHER   0
 Round-robin or other time-sharing scheduling (default).
 
#define SCHED_FIFO   1
 First-in first-out (cooperative) scheduling policy.
 
#define SCHED_RR   2
 Round-robin (preemptive, priority-based) scheduling policy.
 

Functions

int sched_get_priority_min (int policy)
 Get the minimum priority value for a scheduling policy.
 
int sched_get_priority_max (int policy)
 Get the maximum priority value for a scheduling policy.
 
int sched_getparam (pid_t pid, struct sched_param *param)
 Get scheduling parameters for a process.
 
int sched_getscheduler (pid_t pid)
 Get the scheduling policy of a process.
 
int sched_setparam (pid_t pid, const struct sched_param *param)
 Set scheduling parameters for a process.
 
int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param)
 Set the scheduling policy and parameters of a process.
 
int sched_rr_get_interval (pid_t pid, struct timespec *interval)
 Get the round-robin time quantum for a process.
 

Detailed Description

POSIX Priority Scheduling option.

Macro Definition Documentation

◆ SCHED_FIFO

#define SCHED_FIFO   1

First-in first-out (cooperative) scheduling policy.

Definition at line 37 of file sched.h.

◆ SCHED_OTHER

#define SCHED_OTHER   0

Round-robin or other time-sharing scheduling (default).

May execute identically to SCHED_RR on this implementation.

Definition at line 34 of file sched.h.

◆ SCHED_RR

#define SCHED_RR   2

Round-robin (preemptive, priority-based) scheduling policy.

Definition at line 40 of file sched.h.

Function Documentation

◆ sched_get_priority_max()

int sched_get_priority_max ( int  policy)

Get the maximum priority value for a scheduling policy.

Parameters
policySCHED_FIFO, SCHED_RR, or SCHED_OTHER.
Returns
Maximum priority on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_get_priority_max.html

◆ sched_get_priority_min()

int sched_get_priority_min ( int  policy)

Get the minimum priority value for a scheduling policy.

Parameters
policySCHED_FIFO, SCHED_RR, or SCHED_OTHER.
Returns
Minimum priority on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_get_priority_min.html

◆ sched_getparam()

int sched_getparam ( pid_t  pid,
struct sched_param *  param 
)

Get scheduling parameters for a process.

Parameters
pidProcess ID (0 = calling process).
paramOutput: current scheduling parameters.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_getparam.html

◆ sched_getscheduler()

int sched_getscheduler ( pid_t  pid)

Get the scheduling policy of a process.

Parameters
pidProcess ID (0 = calling process).
Returns
Scheduling policy (SCHED_FIFO, SCHED_RR, SCHED_OTHER), or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_getscheduler.html

◆ sched_rr_get_interval()

int sched_rr_get_interval ( pid_t  pid,
struct timespec interval 
)

Get the round-robin time quantum for a process.

Parameters
pidProcess ID (0 = calling process).
intervalOutput: round-robin interval.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_rr_get_interval.html

◆ sched_setparam()

int sched_setparam ( pid_t  pid,
const struct sched_param *  param 
)

Set scheduling parameters for a process.

Parameters
pidProcess ID (0 = calling process).
paramNew scheduling parameters.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_setparam.html

◆ sched_setscheduler()

int sched_setscheduler ( pid_t  pid,
int  policy,
const struct sched_param *  param 
)

Set the scheduling policy and parameters of a process.

Parameters
pidProcess ID (0 = calling process).
policySCHED_FIFO, SCHED_RR, or SCHED_OTHER.
paramNew scheduling parameters.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_setscheduler.html