• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <sched.h>
2 #include <errno.h>
3 #include "syscall.h"
4 #include <string.h>
5 #ifdef __LITEOS_A__
6 #include "pthread_impl.h"
7 #endif
8 
sched_getparam(pid_t pid,struct sched_param * param)9 int sched_getparam(pid_t pid, struct sched_param *param)
10 {
11 	int r;
12 	if (!param) {
13 		r = -EINVAL;
14 		goto exit;
15 	}
16 	memset(param, 0, sizeof(struct sched_param));
17 #ifdef __LITEOS_A__
18 	r = __syscall(SYS_sched_getparam, pid, param, MUSL_TYPE_PROCESS);
19 #else
20 	r = __syscall(SYS_sched_getparam, pid, param);
21 	if (r >= 0) {
22 		r = 0;
23 	}
24 #endif
25 exit:
26 	return __syscall_ret(r);
27 }
28