HP 3000 Manuals

Sending Mail [ Interprocess Communication:Programmer's Guide ] MPE/iX 5.0 Documentation


Interprocess Communication:Programmer's Guide

Sending Mail 

A process sends mail to its parent or child with the SENDMAIL intrinsic.
If the mailbox for the receiving process contains a message sent
previously by the calling process but not collected by the receiving
process, the action taken depends on the waitflag parameter specified in
SENDMAIL.

For example, to send mail to its parent, the following intrinsic call
could be used:

     STAT:=SENDMAIL(0,3,LOCAT,WAITSTAT);

The parameters specified are:

pin              0, specifying that the mail is to be sent to the parent
                 process.

count            3, specifying that the length of the message is three
                 halfwords.

location         LOCAT, an unsigned integer array with the address of the
                 buffer in the stack containing the message to be sent.

waitflag         WAITSTAT, a 16-bit unsigned integer by value.  If bit
                 (15:1)=0, any mail sent previously will be overwritten.
                 If bit (15:1)=1, the intrinsic will wait until the
                 receiving process collects the previous mail before
                 sending the current mail.

The status returned to STAT is one of the following values:

Status           Meaning 

0                The mail was transmitted successfully.  The mailbox
                 contained no previous mail.

1                The mail was transmitted successfully.  The mailbox
                 contained previously sent mail that was overwritten by
                 the new mail, or contained previous incoming/outgoing
                 mail that was cleared.

2                The mail was not transmitted successfully because the
                 mailbox contained incoming mail to be collected by the
                 sending process (regardless of the waitflag parameter
                 setting).  This means that the mailbox currently
                 contains mail sent to the would-be sending process, and
                 the sending process must collect this mail before it can
                 send any itself.

3                An error occurred because an illegal pin was specified
                 or a bounds check failed.

4                An illegal wait request would have produced a deadlock.
                 This means that mail has been sent to the would-be
                 sending process, and the sender is waiting for a reply.

5                The request was rejected because the count specified in
                 the count parameter exceeded the mailbox size allowed by
                 the system.  The maximum size cannot exceed the maximum
                 DST size for the system.

6                The request was rejected because storage resources for
                 the mail data segment were not available.


MPE/iX 5.0 Documentation