[Previous]
[Contents]
[Next]

Reply()

reply to a message sent by another process

Synopsis:

#include <sys/kernel.h>
int Reply( pid_t pid, 
           void *msg, 
           unsigned nbytes );

Description:

The kernel function Reply() replies with nbytes of data pointed to by msg to the process identified by pid. 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.

Reply() is a simple cover function that builds a single part _mxfer_entry on the stack and calls Replymx(), which is the real kernel function. It's provided for convenience, since it's easier to use than Replymx() for simple messages.

Returns:

0
Success
-1
An error occurred. errno is set to indicate the error.

Errors:

EAGAIN
No more Process Manager to Network Manager queue packets available.
EDSTFAULT
Destination would fault on a message pass.
EFAULT
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.
EINTR
Call interrupted by a signal.
EINVAL
The virtual circuit buffer can't be grown because nbytes is invalid.
ENOMEM
The virtual circuit buffer can't be grown because no memory is available.
ESRCH
The process pid doesn't exist.

Examples:

See Send().

Classification:

QNX

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

Caveats:

Reply() is a macro.

See also:

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


[Previous]
[Contents]
[Next]