scheduler_set_parameters(2) - SerenityOS man pages

#Name

scheduler_set_parameters, scheduler_get_parameters - Set and get scheduler parameters for processes and threads

#Description

Modify or retrieve the scheduler parameters for processes or threads. scheduler_set_parameters will affect how the process or thread specified is scheduled the next time, so it might not have an immediately observable effect.

The parameter argument given to both system calls is defined as:

struct SC_scheduler_parameters_params {
    pid_t pid_or_tid;
    SchedulerParametersMode mode;
    struct sched_param parameters;
};

The only currently available scheduling parameter is the int sched_priority, the scheduling priority.

#Security

Both system calls require the proc promise.

There are the following limitations as to which process can modify which process' or thread's parameters:

#Return value

For scheduler_get_parameters, the retrieved parameters are written into the sched_param substructure. In either system call, a return value of 0 indicates success and a non-zero return value indicates an error.

#Errors

#History

The scheduler_set_parameters and scheduler_get_parameters syscalls replace the less generic sched_setparam and sched_getparam syscalls which precisely mirrored POSIX library functions.