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 request is a pointer to a message to be sent to the thread identified by pthread_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 response.
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 request and response 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 pthread_id is the id 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 response argument.