mr_send - send a message to a thread
#include <mrendez.h>
The primitive mr_send() is used to send a message to a thread which is expected to perform an mr_receive(). The argument rqst is a pointer to a message to be sent to the thread identified by id. The port argument specifies the port on the receiver's end through which the message is to be routed. Note that the sending thread blocks until a reply message is received.
When the receiver performs a mr_reply(), it can pass back data in rply.
Currently, the value of timeout must be FOREVER, which indicates that the sender is willing to block until the mr_reply() is forthcoming.
The first two bytes (16 bits) of the rqst and rply argument are taken to be the total size, in bytes, of the appropriate message. The lesser of this size and the size obtained from the receiver's messages represents the number of bytes actually copied by the system.
A positive value for id is the identifier of the thread which received the message. A value of 0 indicates an error. The receiver may return data to the caller in the area pointed to by the rply argument.