Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
Functions
sched.h File Reference
#include <sys/types.h>
#include <time.h>
Include dependency graph for sched.h:

Go to the source code of this file.

Functions

int sched_get_priority_max (int policy)
 Return the maximum priority of the thread can be set. More...
 
int sched_get_priority_min (int policy)
 Return the minimum priority of the thread can be set. More...
 
int sched_rr_get_interval (pid_t pid, struct timespec *tp)
 Write the round-robin time quantum of the scheduler into the timespec structure pointed to by tp. More...
 
int sched_yield (void)
 To cause the calling thread to relinquish the CPU. More...
 

Function Documentation

◆ sched_get_priority_max()

int sched_get_priority_max ( int  policy)
inline

Return the maximum priority of the thread can be set.

Parameters
policyThe scheduling policy to provide. Currently, the system only supports SCHED_RR.
Return values
intThe maximum priority of the thread can be set.

◆ sched_get_priority_min()

int sched_get_priority_min ( int  policy)
inline

Return the minimum priority of the thread can be set.

Parameters
policyThe scheduling policy to provide. Currently, the system only supports SCHED_RR.
Return values
intThe minimum priority of the thread can be set.

◆ sched_rr_get_interval()

int sched_rr_get_interval ( pid_t  pid,
struct timespec tp 
)

Write the round-robin time quantum of the scheduler into the timespec structure pointed to by tp.

Parameters
pidNot used (The whole system shares the same scheduling policy).
tpThe timespec structure to provide.
Return values
intThe minimum priority of the thread can be set.

◆ sched_yield()

int sched_yield ( void  )

To cause the calling thread to relinquish the CPU.

Return values
int0 on success and nonzero error number on error.