HPlogo MPE/iX Intrinsics Reference Manual > Chapter 10 Command Definitions (QUIT-ZSIZE)

SENDMAIL

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Sends mail to another process. Process handling (PH) capability is required.

Syntax



  U16                     I16V I16V    UDS       U16V
  mailstatus := SENDMAIL (pin, length, location, waitflag);

Functional Return


mailstatus

16-bit unsigned integer (assigned functional return)

Returns one of the following values:

ValueMeaning>
0Mail transmitted successfully and mailbox contained no previous mail.
1Mail was transmitted successfully and mailbox contained mail sent previously that was overwritten by the new mail, or contained previous incoming/outgoing mail that was cleared.
2Mail not transmitted successfully; mailbox contained incoming mail to be collected by the sending process (regardless of the waitflag setting).
3Error occurred; an illegal pin parameter was specified or a bounds check failed.
4Illegal wait request; produces a deadlock.
5Request denied; length exceeded the maximum mailbox size allowed by the system.
6Request denied; storage resources for the mail data segment were not available.

Parameters


pin

16-bit signed integer by value (required)

The process to receive the mail. If you specify a child process, pin is the process identification number (PIN) of that process. If a parent process is specified, pin is zero.

length

16-bit signed integer by value (required)

The length of the message, in half words, transmitted from the stack of the sending process. If 0 is specified, the mailbox is emptied of any incoming or outgoing mail.

location

user-defined structure (required)

The buffer containing the message.

waitflag

16-bit unsigned integer by value (required)

Action to be taken if the mailbox contains previously sent mail, as specified in bit (15:1):

ValueMeaning
0Cancel (overwrite) any mail sent previously with the current mail.
1Wait until the receiving process collects the previous mail before sending current mail.

Operation Notes


If the receiving process mailbox contains an uncollected message from the calling process, the action taken depends on the waitflag parameter specified in the SENDMAIL call. If the mailbox currently is being used by another process, SENDMAIL waits until the mailbox is free and then sends the mail.

Condition Codes


CCE (2)Request granted. The mail was sent (value 0 or 1 is returned to mailstatus), or the mail was not sent because the mailbox contained incoming mail to be collected by the sending process (value 2 is returned to mailstatus).
CCG (0)Request denied. An illegal length parameter (value 5 is returned to mailstatus), an illegal pin parameter was specified (value 3 is returned to mailstatus), or storage for the mail data segment was not available (value 6 is returned to mailstatus).
CCL (1)Request denied. The length or location parameter does not allow write access on the stack address (value 3 is returned to mailstatus), or both processes are waiting to send mail (value 4 is returned to mailstatus).

Related Information


Intrinsics MAIL, RECEIVEMAIL
Manuals Interprocess Communication Programmer's Guide




SEARCH


SETDUMP