MPE/iX Intrinsics Reference Manual (32650-90905)
596 Chapter10
Command Definitions (QUIT-ZSIZE)
RECEIVEMAIL
RECEIVEMAIL
NM and CM callable.
Receives mail from another process. Process handling (PH) capability is required.
Syntax
U16 I16V UDS U16V
mailstatus
:=RECEIVEMAIL(
pin,location,waitflag
);
Functional Return
mailstatus
16-bit unsigned integer (assigned functional return)
Returns one of the following values:
Value Meaning
0 Mailbox empty and
waitflag
bit (15:1)=0.
1 No message collected, the mailbox contained outgoing mail
from the receiving process.
2 Message collected successfully.
3 Error occurred because an invalid
pin
was specified or a
bounds check failed.
4 Request denied,
waitflag
specified that the receiving
process wait for mail if the mailbox is empty, but the other
process sharing the mailbox is already suspended, waiting
for mail. If both processes were suspended, neither could
activate the other, and they may be deadlocked.
Parameters
pin
16-bit signed integer by value (required)
The process sending the mail. If you specify a child process,
pin
is the
process identification number (PIN) of that process. If you specify a parent
process,
pin
is zero.
location
user-defined structure (required)
The buffer where the message is written.
waitflag
16-bit unsigned integer by value (required)
The action to be taken if the mailbox is empty. This is determined by the
setting of bit (15:1), which has the following settings:
Value Meaning
0 Return immediately to the calling process.