ash: default to an editing mode
[minix.git] / kernel / system / do_setgrant.c
blob11992fa9e133e8564705e4dd986cd5277936991e
1 /* The kernel call implemented in this file:
2 * m_type: SYS_SETGRANT
4 * The parameters for this kernel call are:
5 * SG_ADDR address of grant table in own address space
6 * SG_SIZE number of entries
7 */
9 #include "kernel/system.h"
10 #include <minix/safecopies.h>
12 /*===========================================================================*
13 * do_setgrant *
14 *===========================================================================*/
15 int do_setgrant(struct proc * caller, message * m_ptr)
17 int r;
19 /* Copy grant table set in priv. struct. */
20 if (RTS_ISSET(caller, RTS_NO_PRIV) || !(priv(caller))) {
21 r = EPERM;
22 } else {
23 _K_SET_GRANT_TABLE(caller,
24 (vir_bytes) m_ptr->SG_ADDR,
25 m_ptr->SG_SIZE);
26 r = OK;
29 return r;