From: Philip Homburg Date: Mon, 23 Apr 2007 13:28:14 +0000 (+0000) Subject: GET_PRIVID: return the ID of a process' privilege structure. X-Git-Tag: v3.1.4~426 X-Git-Url: http://zhaoyanbai.com/repos/dnssec-settime.html?a=commitdiff_plain;h=d80e25068c626f5493b0a58ae72cc7e25ca6fa1e;p=minix.git GET_PRIVID: return the ID of a process' privilege structure. --- diff --git a/kernel/system/do_getinfo.c b/kernel/system/do_getinfo.c index d365105a6..d51e227ae 100644 --- a/kernel/system/do_getinfo.c +++ b/kernel/system/do_getinfo.c @@ -36,7 +36,7 @@ register message *m_ptr; /* pointer to request message */ int proc_nr, nr_e, nr; /* Set source address and length based on request type. */ - switch (m_ptr->I_REQUEST) { + switch (m_ptr->I_REQUEST) { case GET_MACHINE: { length = sizeof(struct machine); src_phys = vir2phys(&machine); @@ -150,7 +150,13 @@ register message *m_ptr; /* pointer to request message */ break; } + case GET_PRIVID: + if (!isokendpt(m_ptr->I_VAL_LEN2_E, &proc_nr)) + return EINVAL; + return proc_addr(proc_nr)->p_priv->s_id; + default: + kprintf("do_getinfo: invalid request %d\n", m_ptr->I_REQUEST); return(EINVAL); }