/* sys_sched_getscheduler - get the policy (scheduling class) of a thread @pid: the pid in question.  */
SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid)
/* sys_sched_getscheduler - get the policy (scheduling class) of a thread @pid: the pid in question.  */
SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid)
{
	struct task_struct *p;
	int retval;
	if (pid < 0)
		return -EINVAL;
	retval = -ESRCH;
	rcu_read_lock();
	p = find_process_by_pid(pid);
	if (p) {
		retval = security_task_getscheduler(p);
		if (!retval)
			retval = p->policy
				| (p->sched_reset_on_fork ? SCHED_RESET_ON_FORK : 0);
	}
	rcu_read_unlock();
	return retval;
}