.th K_receive II 4/21/86
.sh NAME
K_receive - receive an inter-process communication (IPC) message
.sh "MODULA SYNOPSIS"
.nh
.na
 CONST timeOut: cardinal;
.br
 CONST n_pil: pseudo_int_levels;
.br
 VAR msg: ipc_block;
.br
 VAR stat: K_err_num;
.br
 . . .
.br
 stat := NK_receive(timeOut, n_pil, msg);
.br
.hy
.ad
.sp
.sh "C SYNOPSIS"
.nh
.na
 cardinal timeOut;
.br
 pseudo_int_levels n_pil;
.br
 ipc_block msg;
.br
 int stat;
.br
 . . .
.br
 stat = K_receive (timeOut, n_pil,  &msg);
.br
.hy
.ad
.sh DESCRIPTION
K_receive
suspends the execution of a process until the receipt of an IPC
message or until a time out.
The return value
indicates the condition which caused the process to be restarted.
.sp
The first message in the queue of received IPC messages is returned.
If more than
.ag timeOut
`clock ticks' expire before any IPC messages are received, no message
is returned and the error code so indicates.
The
n_pil
parameter sets the pseudo interrupt level of the process before
beginning the wait.
This is analogous to a
K_set_pil
call.
.sh EXCEPTIONS
.lp 22 15
XbNoMes	No messages waiting or received.
.lp 22 15
XbPsLev	Bad pseudo-interrupt level.
.i0
.sh "SEE ALSO"
K_post(II),
K_set_pil(II),
K_signal(II),
ipc_block(IIa)
