minix/minix/kernel/system/do_setgrant.c

31 lines
833 B
C
Raw Normal View History

2006-06-23 17:35:05 +02:00
/* The kernel call implemented in this file:
* m_type: SYS_SETGRANT
*
* The parameters for this kernel call are:
* m_lsys_krn_sys_setgrant.addr address of grant table in own address space
* m_lsys_krn_sys_setgrant.size number of entries
2006-06-23 17:35:05 +02:00
*/
2010-04-02 00:22:33 +02:00
#include "kernel/system.h"
2006-06-23 17:35:05 +02:00
#include <minix/safecopies.h>
/*===========================================================================*
* do_setgrant *
*===========================================================================*/
2012-03-25 20:25:53 +02:00
int do_setgrant(struct proc * caller, message * m_ptr)
2006-06-23 17:35:05 +02:00
{
int r;
/* Copy grant table set in priv. struct. */
if (RTS_ISSET(caller, RTS_NO_PRIV) || !(priv(caller))) {
2006-06-23 17:35:05 +02:00
r = EPERM;
} else {
_K_SET_GRANT_TABLE(caller,
m_ptr->m_lsys_krn_sys_setgrant.addr,
m_ptr->m_lsys_krn_sys_setgrant.size);
2006-06-23 17:35:05 +02:00
r = OK;
}
return r;
}