MentOS  0.8.0
The Mentoring Operating System
Classes | Typedefs | Functions
sched.h File Reference

Structures and functions for managing the scheduler. More...

Go to the source code of this file.

Classes

struct  sched_param
 Structure that describes scheduling parameters. More...
 

Typedefs

typedef struct sched_param sched_param_t
 Structure that describes scheduling parameters.
 

Functions

int sched_setparam (pid_t pid, const sched_param_t *param)
 Sets scheduling parameters. More...
 
int sched_getparam (pid_t pid, sched_param_t *param)
 Gets scheduling parameters. More...
 
int waitperiod (void)
 Placed at the end of an infinite while loop, stops the process until, its next period starts. The calling process must be a periodic one. More...
 

Detailed Description

Structures and functions for managing the scheduler.

Function Documentation

◆ sched_getparam()

int sched_getparam ( pid_t  pid,
sched_param_t param 
)

Gets scheduling parameters.

Parameters
pidpid of the process we want to retrieve the parameters. If zero, then the parameters of the calling process are returned.
paramThe interpretation of the argument param depends on the scheduling policy of the thread identified by pid.
Returns
0 on success, -1 on failure and errno is set to indicate the error.

◆ sched_setparam()

int sched_setparam ( pid_t  pid,
const sched_param_t param 
)

Sets scheduling parameters.

Parameters
pidpid of the process we want to change the parameters. If zero, then the parameters of the calling process are set.
paramThe interpretation of the argument param depends on the scheduling policy of the thread identified by pid.
Returns
0 on success, -1 on failure and errno is set to indicate the error.

◆ waitperiod()

int waitperiod ( void  )

Placed at the end of an infinite while loop, stops the process until, its next period starts. The calling process must be a periodic one.

Returns
0 on success, -1 on failure and errno is set to indicate the error.