1*433d6423SLionel Sambuc /* The kernel call implemented in this file: 2*433d6423SLionel Sambuc * m_type: SYS_SETGRANT 3*433d6423SLionel Sambuc * 4*433d6423SLionel Sambuc * The parameters for this kernel call are: 5*433d6423SLionel Sambuc * m_lsys_krn_sys_setgrant.addr address of grant table in own address space 6*433d6423SLionel Sambuc * m_lsys_krn_sys_setgrant.size number of entries 7*433d6423SLionel Sambuc */ 8*433d6423SLionel Sambuc 9*433d6423SLionel Sambuc #include "kernel/system.h" 10*433d6423SLionel Sambuc #include <minix/safecopies.h> 11*433d6423SLionel Sambuc 12*433d6423SLionel Sambuc /*===========================================================================* 13*433d6423SLionel Sambuc * do_setgrant * 14*433d6423SLionel Sambuc *===========================================================================*/ do_setgrant(struct proc * caller,message * m_ptr)15*433d6423SLionel Sambucint do_setgrant(struct proc * caller, message * m_ptr) 16*433d6423SLionel Sambuc { 17*433d6423SLionel Sambuc int r; 18*433d6423SLionel Sambuc 19*433d6423SLionel Sambuc /* Copy grant table set in priv. struct. */ 20*433d6423SLionel Sambuc if (RTS_ISSET(caller, RTS_NO_PRIV) || !(priv(caller))) { 21*433d6423SLionel Sambuc r = EPERM; 22*433d6423SLionel Sambuc } else { 23*433d6423SLionel Sambuc _K_SET_GRANT_TABLE(caller, 24*433d6423SLionel Sambuc m_ptr->m_lsys_krn_sys_setgrant.addr, 25*433d6423SLionel Sambuc m_ptr->m_lsys_krn_sys_setgrant.size); 26*433d6423SLionel Sambuc r = OK; 27*433d6423SLionel Sambuc } 28*433d6423SLionel Sambuc 29*433d6423SLionel Sambuc return r; 30*433d6423SLionel Sambuc } 31