reply to a message from another process


#include <sys/kernel.h>
#include <sys/sendmx.h>
int Replymx( pid_t pid,
             unsigned parts,
             struct _mxfer_entry *msgmx );


The kernel function Replymx() replies with a message taken from the array of message buffers pointed to by msgmx to the process identified by pid. The number of elements in this array is given by nparts, which must not exceed _QNX_MXTAB_LEN (defined in <limits.h>). The size of the message is the sum of the sizes of each buffer. The process pid must have sent a message that was received and not yet replied to. It must be in the REPLY BLOCKED state.

The number of bytes transferred is the minimum of that specified by both the replier and the sender. The reply data isn't allowed to overflow the reply buffer area provided by the sender.

The data transfer occurs immediately, and the replying task doesn't block. Reply() changes the state of the sending task from REPLY BLOCKED to READY. You should reply to every message that you receive, but you don't have to do so immediately.

It's quite common to reply with 2-part messages consisting of a fixed header and a buffer of data. The Replymx() will gather the data from the buffer list into a logically contiguous message and transfer it to the sender's reply buffer(s). The sender need not specify the same number or size of buffers. The data is laid down, filling each buffer as required. The file system, for example, builds a reply list pointing into its cache in order to reply with what looks like one contiguous piece of data.

Note: Avoid stuffing each _mxfer_entry directly. Instead use the _setmx() macro to stuff each entry. This will make your code portable across 16- and 32-bit platforms.


An error occurred. errno is set to indicate the error.


No more Process Manager to Network Manager queue packets available.
Destination would fault on a message pass.
In order to complete the message exchange, the current process would have incurred a segment violation. You need to make your buffer(s) larger, or limit the number of bytes allowed in the transfer.
Call interrupted by a signal.
The virtual circuit buffer can't be grown due to an invalid message length.
The virtual circuit buffer can't be grown because no memory is available.
The process pid doesn't exist.


See Sendmx().



Interrupt handler No
Signal handler Yes, but modifies errno
Thread Yes


Replymx() is a macro.

See also:

Creceive(), Creceivemx(), errno, Readmsg(), Readmsgmx(), Receive(), Receivemx(), Reply(), Send(), Sendfd(), Sendfdmx(), Sendmx(), Writemsg(), Writemsgmx(), Trigger()