/* sys_sched_getparam - get the RT priority of a thread @pid: the pid in question.  */
SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param)
/* sys_sched_getparam - get the RT priority of a thread @pid: the pid in question.  */
SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param)
{
	struct sched_param lp;
	struct task_struct *p;
	int retval;
	if (!param || pid < 0)
		return -EINVAL;
	rcu_read_lock();
	p = find_process_by_pid(pid);
	retval = -ESRCH;
	if (!p)
		goto out_unlock;
	retval = security_task_getscheduler(p);
	if (retval)
		goto out_unlock;
	lp.sched_priority = p->rt_priority;
	rcu_read_unlock();
	retval = copy_to_user(param, &lp, sizeof(*param)) ? -EFAULT : 0;
	return retval;
out_unlock:
	rcu_read_unlock();
	return retval;
}