Hello everyone,

I am slowly reading the source code of Minix (at least, I am trying
to).

I have a question related to the following piece of code:

07496 /* Check if the process has privileges for the requested call.
Calls to the
07497 * kernel may only be SENDREC, because tasks always reply and
may not block
07498 * if the caller doesn't do receive().
07499 */
07500 if (! (priv(caller_ptr)->s_trap_mask & (1 << function)) ||
07501 (iskerneln(src_dst) && function != SENDREC
07502 && function != RECEIVE)) {
07503 kprintf("sys_call: trap %d not allowed, caller %d, src_dst
%d\n",
07504 function, proc_nr(caller_ptr), src_dst);
07505 return(ECALLDENIED); /* trap denied by mask
or kernel */
07506 }

Is not the following condition:

(iskerneln(src_dst) && function != SENDREC && function != RECEIVE)

superfluous?

I guess that it says that no task can perform anything else but SENDREC
or RECEIVE. I think that a stronger requirement is already stored in

(priv(caller_ptr)->s_trap_mask

Of perhaps `(priv(caller_ptr)->s_trap_mask' does not convey all the
information which is needed?