MPE/iX Intrinsics Reference Manual (32650-90905)

498 Chapter9
Command Definitions (MAIL-PUTJCW)
MAIL
MAIL
NM and CM callable.
Determines the status of the mailbox used by its parent or child. Process handling (PH)
capability is required.
Syntax
U16 I16V I16
mailstatus
:=MAIL(
pin,length
);
Functional Return
mailstatus
16-bit unsigned integer (assigned functional return)
Returns the status of the mailbox:
Value Meaning
0 Mailbox empty.
1 Contains previous outgoing mail from this calling process
that the destination process has not yet collected.
2 Contains incoming mail awaiting collection by this calling
process. The length of the mail is returned in
length
.
3 An error occurred, an invalid
pin
was specified, or a
bounds check failed.
4 Temporarily inaccessible, other intrinsics are using it in
the preparation or analysis of mail.
Parameters
pin
16-bit signed integer by value (required)
Passes the mailbox to be tested. If
pin
specifies the mailbox of a child
process, it must be the process identification number (PIN) of that child.
Zero specifies the mailbox of a parent process.
length
16 bit signed integer by reference (required)
Returns the length, in half words, of any incoming mail in the mailbox.
Operation Notes
If the mailbox contains mail that is awaiting collection by this process, the length of this
message (in half words) is returned to the calling process in the
length
parameter. This
enables the calling process to initialize its stack in preparation for receipt of the message.