1 #include <sched.h>
2 #include <errno.h>
3 #include "syscall.h"
4 #include <string.h>
5 
sched_getparam(pid_t pid, struct sched_param *param)6 int sched_getparam(pid_t pid, struct sched_param *param)
7 {
8 	int r;
9 	if (!param) {
10 		r = -EINVAL;
11 		goto exit;
12 	}
13 	memset(param, 0, sizeof(struct sched_param));
14 	r = __syscall(SYS_sched_getparam, pid , param);
15 	if (r >= 0) {
16 		r = 0;
17 	}
18 exit:
19 	return __syscall_ret(r);
20 }
21