1 #include <sched.h>
2 #include <errno.h>
3 #include "syscall.h"
4 #ifdef __LITEOS_A__
5 #include "pthread_impl.h"
6 #endif
7
sched_setscheduler(pid_t pid, int sched, const struct sched_param *param)8 int sched_setscheduler(pid_t pid, int sched, const struct sched_param *param)
9 {
10 int r;
11 if (!param) {
12 r = -EINVAL;
13 goto exit;
14 }
15 #ifdef __LITEOS_A__
16 r = __syscall(SYS_sched_setscheduler, pid, sched, param, MUSL_TYPE_PROCESS);
17 #else
18 r = __syscall(SYS_sched_setscheduler, pid, sched, param);
19 #endif
20 exit:
21 return __syscall_ret(r);
22 }
23