3.1.7 branch.
[minix.git] / kernel / system / do_schedctl.c
blob592b7d4f245a002b2c61e1c6a0afc961a4a360fd
1 #include "kernel/system.h"
2 #include <signal.h>
3 #include <sys/sigcontext.h>
4 #include <minix/endpoint.h>
6 /*===========================================================================*
7 * do_schedctl *
8 *===========================================================================*/
9 PUBLIC int do_schedctl(struct proc * caller, message * m_ptr)
11 struct proc *p;
13 /* Only system processes can change process schedulers */
14 if (! (priv(caller)->s_flags & SYS_PROC))
15 return(EPERM);
17 p = proc_addr(_ENDPOINT_P(m_ptr->SCHEDULING_ENDPOINT));
18 p->p_scheduler = caller;
20 return(OK);