xref: /minix3/minix/kernel/system/do_statectl.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc /* The kernel call implemented in this file:
2*433d6423SLionel Sambuc  *   m_type:	SYS_STATECTL
3*433d6423SLionel Sambuc  *
4*433d6423SLionel Sambuc  * The parameters for this kernel call are:
5*433d6423SLionel Sambuc  *   m_lsys_krn_sys_statectl.request	(state control request)
6*433d6423SLionel Sambuc  */
7*433d6423SLionel Sambuc 
8*433d6423SLionel Sambuc #include "kernel/system.h"
9*433d6423SLionel Sambuc 
10*433d6423SLionel Sambuc #if USE_STATECTL
11*433d6423SLionel Sambuc 
12*433d6423SLionel Sambuc /*===========================================================================*
13*433d6423SLionel Sambuc  *			          do_statectl				     *
14*433d6423SLionel Sambuc  *===========================================================================*/
15*433d6423SLionel Sambuc int do_statectl(struct proc * caller, message * m_ptr)
16*433d6423SLionel Sambuc {
17*433d6423SLionel Sambuc /* Handle sys_statectl(). A process has issued a state control request. */
18*433d6423SLionel Sambuc 
19*433d6423SLionel Sambuc   switch(m_ptr->m_lsys_krn_sys_statectl.request)
20*433d6423SLionel Sambuc   {
21*433d6423SLionel Sambuc   case SYS_STATE_CLEAR_IPC_REFS:
22*433d6423SLionel Sambuc 	/* Clear IPC references for all the processes communicating
23*433d6423SLionel Sambuc 	 * with the caller.
24*433d6423SLionel Sambuc 	 */
25*433d6423SLionel Sambuc 	clear_ipc_refs(caller, EDEADSRCDST);
26*433d6423SLionel Sambuc 	return(OK);
27*433d6423SLionel Sambuc   default:
28*433d6423SLionel Sambuc 	printf("do_statectl: bad request %d\n",
29*433d6423SLionel Sambuc 		m_ptr->m_lsys_krn_sys_statectl.request);
30*433d6423SLionel Sambuc 	return EINVAL;
31*433d6423SLionel Sambuc   }
32*433d6423SLionel Sambuc }
33*433d6423SLionel Sambuc 
34*433d6423SLionel Sambuc #endif /* USE_STATECTL */
35