minix/kernel/system/do_schedctl.c
Kees van Reeuwijk 826b9590f2 More endpoint_t correctness.
More const correctness.
Other code cleanup.
2010-06-08 14:09:18 +00:00

23 lines
607 B
C

#include "kernel/system.h"
#include <minix/endpoint.h>
/*===========================================================================*
* do_schedctl *
*===========================================================================*/
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);
if (!isokendpt(m_ptr->SCHEDULING_ENDPOINT, &proc_nr))
return EINVAL;
p = proc_addr(proc_nr);
p->p_scheduler = caller;
return(OK);
}