ReplySmallMsg

Sends a reply to a small message.

Synopsis

Err ReplySmallMsg( Item msg, int32 result, uint32 val1, uint32val2)

Description

This procedure sends a reply to a small message. (To reply to a standard or buffered message, use ReplyMsg().)

This procedure is identical to ReplyMsg() except that arguments are cast as (uint32) instead of (void *) and (int32). A small message can return only eight bytes of data: four that you provide in the val1 argument, and four that you provide in the val2 argument.

When replying to a message, send back the same message item you received. (Think of this as sending a reply in the same envelope as the original letter.) You can include an optional result code (which you provide in the result argument). Note that no standard result codes are currently defined; the result code must be a value whose meaning is agreed upon by the sending and receiving tasks. For consistency, use negative numbers for errors.

Arguments

msg
The item number of the message. Note: The reply message item must be same message item that was received.
result
A result code. This code is placed in the msg_Result field of the message data structure before the reply is sent.
val1
The first four bytes of data for the reply. This data is put into the msg_DataPtr field of the message structure.
val2
The last four bytes of data for the reply. This data is put into the msg_DataSize field of the message structure.

Return Value

The procedure returns 0 if the reply was sent successfully or an error code if there was an error.

Implementation

SWI implemented in kernel folio V20.

Associated Files

msgport.h
ANSI C Prototype

See Also

GetMsg(), GetThisMsg(), ReplyMsg(), SendMsg(), SendSmallMsg(), WaitPort()