PUBLIC int do_schedctl(struct proc * caller, message * m_ptr)
{
struct proc *p;
+ int proc_nr;
/* Only system processes can change process schedulers */
if (! (priv(caller)->s_flags & SYS_PROC))
return(EPERM);
- p = proc_addr(_ENDPOINT_P(m_ptr->SCHEDULING_ENDPOINT));
+ if (!isokendpt(m_ptr->SCHEDULING_ENDPOINT, &proc_nr))
+ return EINVAL;
+
+ p = proc_addr(proc_nr);
p->p_scheduler = caller;
return(OK);
PUBLIC int do_schedule(struct proc * caller, message * m_ptr)
{
struct proc *p;
+ int proc_nr;
+
+ if (!isokendpt(m_ptr->SCHEDULING_ENDPOINT, &proc_nr))
+ return EINVAL;
p = proc_addr(_ENDPOINT_P(m_ptr->SCHEDULING_ENDPOINT));