sched_setparam 2. Syntax 3. Param 4. Return Value 5. Remark 6. Example 7. Issue

Set scheduling parameters (REALTIME).

The sched_setscheduler() function shall set scheduling parameters of the pid process to param. The value of the sched_param::sched_priority member shall be any integer within the inclusive priority range for the current scheduling policy of pid process.

2. Syntax

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

3. Param

pid

Process pid.

If pid exists, and if the calling process has permission, scheduling parameters shall be set for pid process.

If pid is zero, the scheduling parameters shall be set for the calling process.

param

sched_param structure.

4. Return Value

Upon successful, return the former scheduling policy of pid process; otherwise, the priority shall remain unchanged, return -1, and set errno to indicate the error.

5. Remark

-

  • If the value of pid is negative, the behavior of the sched_setscheduler() function is unspecified.

6. Example

7. Issue